cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A382545 a(n) = A071324(n) - A000010(n).

This page as a plain text file.
%I A382545 #35 Jun 02 2025 15:29:22
%S A382545 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,
%T A382545 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,
%U A382545 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
%N A382545 a(n) = A071324(n) - A000010(n).
%C A382545 a(n) >= 0, as A071324(n) >= A000010(n) for all n.
%H A382545 Shreyansh Jaiswal, <a href="/A382545/b382545.txt">Table of n, a(n) for n = 1..10000</a>
%F A382545 a(p) = 0 for prime p, as A071324(p) = p-1 = A000010(p).
%e A382545 a(100) = A071324(100) - A000010(100) = 63 - 40 = 23.
%t A382545 a[n_] := Plus @@ (-(d = Divisors[n])*(-1)^(Range[Length[d], 1, -1])) - EulerPhi[n]; Array[a, 100] (* _Amiram Eldar_, Apr 23 2025 *)
%o A382545 (Python)
%o A382545 from sympy import divisors;from functools import lru_cache; from sympy import totient
%o A382545 cached_divisors = lru_cache()(divisors)
%o A382545 def c(n): return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n))))
%o A382545 for n in range(1, 101): print((c(n)-totient(n)),end=", ")
%o A382545 (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
%Y A382545 Cf. A000010, A071324.
%K A382545 nonn
%O A382545 1,6
%A A382545 _Shreyansh Jaiswal_, Apr 23 2025