A326297 If n = Product (p_j^k_j) then a(n) = Product ((p_j - 1)^(k_j - 1)).
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
Examples
a(98) = a(2 * 7^2) = (2 - 1)^(1 - 1) * (7 - 1)^(2 - 1) = 6.
Links
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
Dirichlet g.f.: Product_{p prime} (1 + 1/(p^s - p + 1)). - Amiram Eldar, Dec 07 2023