login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A070819
Values of commutator[phi,gpf] = commutator[A000010, A006530] at prime arguments; a(1)=0 by convention.
2
0, 0, 2, 3, 5, 9, 14, 15, 11, 21, 25, 33, 35, 35, 23, 39, 29, 55, 55, 63, 69, 65, 41, 77, 93, 95, 85, 53, 105, 105, 119, 117, 119, 115, 111, 145, 143, 159, 83, 129, 89, 175, 171, 189, 189, 187, 203, 185, 113, 209, 203, 221, 235, 245, 254, 131, 201, 265, 253, 273
OFFSET
1,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = phi(gpf(prime(n))) - gpf(phi(prime(n))) = A070812(A000040(n)) where phi(w) = Euler totient of w and gpf(w) is the largest prime factor of w. So a(n) = prime(n) - 1 - q. See also A070813 when q = 2.
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