P.S. (For "and" case) Interestingly, n cannot be a multiple of 21 (or of 2, or of 9, 25... or more generally, must be squarefree. This is easily proven.)
More generally, if n = p*q*... and p  phi(q), then n is not in the sequence.
The case of n = 2*a is a bit trickier. Either 3  n and then 2  phi(3) and n is not in the sequence or 3 doesn't divide n, but then 3 divides either nphi(n) or either n+phi(n).
Last fiddled with by Batalov on 20170126 at 01:48
