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.

A304407 If n = Product (p_j^k_j) then a(n) = Product ((p_j - 1)*k_j).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 3, 4, 4, 10, 4, 12, 6, 8, 4, 16, 4, 18, 8, 12, 10, 22, 6, 8, 12, 6, 12, 28, 8, 30, 5, 20, 16, 24, 8, 36, 18, 24, 12, 40, 12, 42, 20, 16, 22, 46, 8, 12, 8, 32, 24, 52, 6, 40, 18, 36, 28, 58, 16, 60, 30, 24, 6, 48, 20, 66, 32, 44, 24, 70, 12, 72, 36, 16
Offset: 1

Views

Author

Ilya Gutkovskiy, May 12 2018

Keywords

Examples

			a(60) = a(2^2*3*5) = (2 - 1)*2 * (3 - 1)*1 * (5 - 1)*1 = 16.
		

Crossrefs

Programs

  • Maple
    seq(mul((p-1)*padic[ordp](n, p), p in numtheory[factorset](n)), n=1..100); # Ridouane Oudra, Jun 06 2025
  • Mathematica
    a[n_] := Times @@ ((#[[1]] - 1) #[[2]] & /@ FactorInteger[n]); a[1] = 1; Table[a[n], {n, 75}]
    Table[EulerPhi[Last[Select[Divisors[n], SquareFreeQ]]] DivisorSigma[0, n/Last[Select[Divisors[n], SquareFreeQ]]], {n, 75}]
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); (p-1)*e)} \\ Andrew Howroyd, Jul 24 2018

Formula

a(n) = A005361(n)*abs(A023900(n)) = A005361(n)*A173557(n) = A005361(n)*A000010(A007947(n)).
a(p^k) = (p - 1)*k where p is a prime and k > 0.
a(n) = phi(n) if n is a squarefree (A005117), where phi() = A000010.
a(A002110(k)) = A005867(k).
Sum_{k=1..n} a(k) ~ c * n^2, where c = (Pi^4/72) * Product_{p prime} (1 - 4/p^2 + 3/p^3 + 1/p^4 - 1/p^5) = 0.2644703894... . - Amiram Eldar, Nov 30 2022
a(n) = (-1)^A001221(n) * (Sum_{d1|n} Sum_{d2|n} mu(d1)*gcd(d1,d2)). - Ridouane Oudra, Jun 06 2025