login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #51 Nov 01 2024 11:49:15

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

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

%U 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

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

%H Antti Karttunen, <a href="/A326297/b326297.txt">Table of n, a(n) for n = 1..20000</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>.

%F a(n) = A003958(n) / abs(A023900(n)) = abs(A325126(n)) / A007947(n).

%F Dirichlet g.f.: Product_{p prime} (1 + 1/(p^s - p + 1)). - _Amiram Eldar_, Dec 07 2023

%F a(n) = A003958(n)/A173557(n). - _Ridouane Oudra_, Oct 29 2024

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

%p seq(mul((p-1)^(padic[ordp](n,p)-1), p in numtheory[factorset](n)), n =1..100); # _Ridouane Oudra_, Oct 29 2024

%t a[n_] := If[n == 1, 1, Times @@ ((#[[1]] - 1)^(#[[2]] - 1) & /@ FactorInteger[n])]; Table[a[n], {n, 1, 100}]

%o (PARI) a(n) = my(f=factor(n)); for (k=1, #f~, f[k,1]--; f[k,2]--); factorback(f); \\ _Michel Marcus_, Mar 03 2020

%o (Python)

%o from math import prod

%o from sympy import factorint

%o def a(n): return prod((p-1)**(e-1) for p, e in factorint(n).items())

%o print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Aug 30 2021

%Y Cf. A003557, A003958, A003959, A007947, A023900, A064478, A064549, A122132 (positions of 1's), A125131, A173557, A325126, A327564.

%K nonn,mult

%O 1,9

%A _Ilya Gutkovskiy_, Mar 03 2020