A382545 a(n) = A071324(n) - A000010(n).
0, 0, 0, 1, 0, 2, 0, 1, 1, 2, 0, 4, 0, 2, 4, 3, 0, 7, 0, 4, 4, 2, 0, 8, 1, 2, 2, 6, 0, 14, 0, 5, 4, 2, 8, 13, 0, 2, 4, 8, 0, 20, 0, 10, 12, 2, 0, 16, 1, 11, 4, 12, 0, 22, 8, 14, 4, 2, 0, 24, 0, 2, 10, 11, 8, 28, 0, 16, 4, 18, 0, 25, 0, 2, 22, 18, 12, 32, 0, 16, 7, 2, 0, 30, 8, 2, 4, 20, 0, 44, 12, 22, 4, 2, 8, 32, 0, 15, 10, 23
Offset: 1
Keywords
Examples
a(100) = A071324(100) - A000010(100) = 63 - 40 = 23.
Links
- Shreyansh Jaiswal, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := Plus @@ (-(d = Divisors[n])*(-1)^(Range[Length[d], 1, -1])) - EulerPhi[n]; Array[a, 100] (* Amiram Eldar, Apr 23 2025 *)
-
PARI
a(n) = my(f=factor(n), d=Vecrev(divisors(f))); sum(k=1, #d, (-1)^(k+1)*d[k]) - eulerphi(f); \\ Michel Marcus, Apr 23 2025
-
Python
from sympy import divisors;from functools import lru_cache; from sympy import totient cached_divisors = lru_cache()(divisors) def c(n): return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n)))) for n in range(1, 101): print((c(n)-totient(n)),end=", ")
Comments