OFFSET
1,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
For n = 100, prime(100) = 541, phi(541) = 540, gpf(540) = 5, gpf(541) = 541, phi(541) = 540, a(100) = 540 - 5 = 535.
MATHEMATICA
pf[x_] := Part[Reverse[Flatten[FactorInteger[x]]], 2] f[x_] := EulerPhi[pf[x]]-pf[EulerPhi[x]] Table[f[Prime[w]], {w, 1, 128}]
PROG
(PARI) a(n)=if(n>2, my(p=prime(n), f=factor(p-1)[, 1]); p-1-f[#f], 0) \\ Charles R Greathouse IV, Feb 21 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 10 2002
STATUS
approved