login
Values of commutator[phi,gpf] = commutator[A000010, A006530] at prime arguments; a(1)=0 by convention.
2

%I #19 Aug 20 2024 03:09:24

%S 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,

%T 95,85,53,105,105,119,117,119,115,111,145,143,159,83,129,89,175,171,

%U 189,189,187,203,185,113,209,203,221,235,245,254,131,201,265,253,273

%N Values of commutator[phi,gpf] = commutator[A000010, A006530] at prime arguments; a(1)=0 by convention.

%H Charles R Greathouse IV, <a href="/A070819/b070819.txt">Table of n, a(n) for n = 1..10000</a>

%F 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.

%e For n = 100, prime(100) = 541, phi(541) = 540, gpf(540) = 5, gpf(541) = 541, phi(541) = 540, a(100) = 540 - 5 = 535.

%t pf[x_] := Part[Reverse[Flatten[FactorInteger[x]]], 2] f[x_] := EulerPhi[pf[x]]-pf[EulerPhi[x]] Table[f[Prime[w]], {w, 1, 128}]

%o (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

%Y Cf. A000010, A000040, A006530, A070812, A070813.

%K nonn

%O 1,3

%A _Labos Elemer_, May 10 2002