OFFSET
1,4
COMMENTS
Multiplicative with a(p^e) = 0 if e = 1, p^2 - 1 if e = 2 and p^e - p^(e-1) otherwise. - Amiram Eldar, Nov 18 2021
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
MATHEMATICA
f[p_, e_] := Which[e > 2, p^e - p^(e - 1), e == 2, p^2 - 1, e == 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 18 2021 *)
PROG
(PARI)
A057521(n) = { my(f=factor(n)); prod(i=1, #f~, if(f[i, 2]>1, f[i, 1]^f[i, 2], 1)); }; \\ From A057521
(Python)
from math import prod
from sympy import factorint
def A349379(n): return prod(0 if e==1 else p**e - (1 if e==2 else p**(e-1)) for p, e in factorint(n).items()) # Chai Wah Wu, Nov 14 2022
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Nov 18 2021
STATUS
approved