Solution:
Let p1,p2,…,pk be the prime divisors of n. Then it is known that φ(n)=n⋅p1p1−1…pkpk−1. As n2 and n have the same set of prime divisors, it also holds that φ(n2)=n2⋅p1p1−1…pkpk−1. We will examine the equality in four cases.
- gcd(n,2019)=1 In this case, 2019⋅n has also 3 and 673 as prime divisors, thus φ(2019⋅n)=2019⋅n⋅p1p1−1…pkpk−1⋅32⋅673672, and the equality implies n=1342, however gcd(1342,3)=1, contradiction. Thus, there is no answer in this case.
- gcd(n,2019)=3 In this case, 2019⋅n has also 673 as a prime divisor, thus φ(2019⋅n)=2019⋅n⋅p1p1−1…pkpk−1⋅673672, and the equality implies n=2016, which satisfies the equation. Thus, the only answer in this case is n=2016.
- gcd(n,2019)=673 In this case, 2019⋅n has also 3 as a prime divisor, thus φ(2019⋅n)=2019⋅n⋅p1p1−1…pkpk−1⋅32, and the equality implies n=1346, which satisfies the equation. Thus, the only answer in this case is n=1346.
- gcd(n,2019)=2019 In this case, 2019⋅n has the same set of prime divisors, thus φ(2019⋅n)=2019⋅n⋅p1p1−1…pkpk−1, and the equality implies n=2019, which satisfies the equation. Thus, the only answer in this case is n=2019.
Thus, all the answers are n=1346,2016,2019.