The sequence is infinite. If n=prod(pi^ei) with each pi prime, then phi(n) = n*prod((pi-1)/pi) and n' = n*sum(ei/pi). Thus every number of the form p^(p-1), where p is prime, is in this sequence. - Nathaniel Johnston, Nov 27 2010
If p > q are primes and q does not divide p-1, there is a solution in positive integers of (p-1)*(q-1) = a*p + b*q, and then p^b*q^a is in the sequence. - Robert Israel, Aug 21 2014
(*Run the Mathematica program given in A003415 first, to define the function a as the arithmetic derivative.*) Select[Range[0, 10000], EulerPhi[ # ] == a[ # ] &]
PROG
(Python)
from sympy import factorint, totient
A166374 = [n for n in range(1, 10**6) if sum([int(n*e/p) for p, e in factorint(n).items()]) == totient(n)] # Chai Wah Wu, Aug 22 2014, edited by Antti Karttunen, Mar 13 2021