cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Labos Elemer, May 10 2002

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    pf[x_] := Part[Reverse[Flatten[FactorInteger[x]]], 2] f[x_] := EulerPhi[pf[x]]-pf[EulerPhi[x]] Table[f[Prime[w]], {w, 1, 128}]
  • 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

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.