A204617 Multiplicative with a(p^e) = p^(e-1)*H(p). H(2) = 1, H(p) = p - 1 if p == 1 (mod 4) and H(p) = p + 1 if p == 3 (mod 4).
1, 1, 4, 2, 4, 4, 8, 4, 12, 4, 12, 8, 12, 8, 16, 8, 16, 12, 20, 8, 32, 12, 24, 16, 20, 12, 36, 16, 28, 16, 32, 16, 48, 16, 32, 24, 36, 20, 48, 16, 40, 32, 44, 24, 48, 24, 48, 32, 56, 20, 64, 24, 52, 36, 48, 32, 80, 28, 60, 32, 60, 32, 96, 32, 48, 48, 68, 32
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Programs
-
Maple
with(numtheory): a := n->add(jacobi(-1,d)*mobius(d)*n/d, d in divisors(n)): seq(a(n), n = 1..60); # Peter Bala, Dec 26 2023
-
Mathematica
ar[p_,s_] := Which[Mod[p,4]==1, p^(s-1)*(p-1), Mod[p,4]==3, p^(s-1)*(p+1), True,p^(s-1)]; arit[1] = 1; arit[n_] := Product[ar[FactorInteger[n][[i,1]], FactorInteger[n][[i,2]]], {i, Length[FactorInteger[n]]}]; Array[arit, 100]
-
PARI
A204617(n) = { my(f=factor(n),p); prod(i=1, #f~, p=f[i, 1]; (p^(f[i, 2]-1)) * if(2==p,1,if(1==(p%4),p-1,p+1))); }; \\ Antti Karttunen, Nov 16 2021
Formula
a(n) = phi(n) if n is in A072437.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (3/8) * Product_{primes p == 1 (mod 4)} (1 - 1/p^2) * Product_{primes p == 3 (mod 4)} (1 + 1/p^2) = 3*A243381/(8*A175647) = 0.409404... . - Amiram Eldar, Dec 24 2022
a(n) = n*Product_{primes p, p | n} (1 - A034947(p)/p) = Sum_{d | n} A034947(d)* mobius(d)*n/d. Cf. A000010(n) = Sum_{d | n} mobius(d)*n/d. - Peter Bala, Dec 26 2023