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.

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

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 6, 4, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 6, 2, 4
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 03 2020

Keywords

Examples

			a(98) = a(2 * 7^2) = (2 - 1)^(1 - 1) * (7 - 1)^(2 - 1) = 6.
		

Crossrefs

Programs

  • Maple
    seq(mul((p-1)^(padic[ordp](n,p)-1), p in numtheory[factorset](n)), n =1..100); # Ridouane Oudra, Oct 29 2024
  • Mathematica
    a[n_] := If[n == 1, 1, Times @@ ((#[[1]] - 1)^(#[[2]] - 1) & /@ FactorInteger[n])]; Table[a[n], {n, 1, 100}]
  • PARI
    a(n) = my(f=factor(n)); for (k=1, #f~, f[k,1]--; f[k,2]--); factorback(f); \\ Michel Marcus, Mar 03 2020
    
  • Python
    from math import prod
    from sympy import factorint
    def a(n): return prod((p-1)**(e-1) for p, e in factorint(n).items())
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Aug 30 2021

Formula

a(n) = A003958(n) / abs(A023900(n)) = abs(A325126(n)) / A007947(n).
Dirichlet g.f.: Product_{p prime} (1 + 1/(p^s - p + 1)). - Amiram Eldar, Dec 07 2023
a(n) = A003958(n)/A173557(n). - Ridouane Oudra, Oct 29 2024