OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harry J. Smith)
FORMULA
EXAMPLE
Because phi(108) = 36, 108 - phi(108) = 72 = cototient(108), cototient(36) = 36 - 12 = 24, totient(72) = 24, so 108 is the sequence.
MATHEMATICA
eu[n_] := EulerPhi[n]; co[n_] := n - EulerPhi[n]; Flatten[Position[Table[co[eu[m]] - eu[co[m]], {m, 1, 1000}], 0]]
(* alternative program *)
Select[Range[500], EulerPhi[#] - EulerPhi[EulerPhi[#]] == EulerPhi[# - EulerPhi[#]] &] (* Alonso del Arte, Jun 12 2013 *)
PROG
(PARI) { n=0; for (m = 1, 10^9, t=eulerphi(m); c=m - t; if (m>1, f=t - eulerphi(t) - eulerphi(c), f=0); if (f==0, write("b065153.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 13 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Oct 19 2001
STATUS
approved