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.
%I A363421 #40 Aug 06 2023 08:15:56 %S A363421 1,0,-1,0,-3,8,-5,24,7,32,27,80,11,120,91,112,105,224,119,288,171,280, %T A363421 315,440,207,480,475,520,459,728,435,840,651,832,891,952,665,1224, %U A363421 1147,1216,975,1520,1107,1680,1419,1496,1755,2024,1363,2112,1911,2200,2091 %N A363421 a(n) = Sum_{k=0..n}(n^[not(k | n)] - n^[k | n]), where '[ ]' denotes the Iverson bracket. %H A363421 Peter Luschny, <a href="/A363421/b363421.txt">Table of n, a(n) for n = 0..10000</a> %F A363421 a(n) = n^2 - 2*(n - 1)*tau(n) - 1 for n >= 1, where tau = A000005. %t A363421 A363421[n_]:=If[n==0,1,n^2-2(n-1)DivisorSigma[0,n]-1];Array[A363421,100,0] (* _Paolo Xausa_, Aug 06 2023 *) %o A363421 (SageMath) %o A363421 print([sum(n^(not k.divides(n)) - n^k.divides(n) for k in srange(n+1)) for n in srange(53)]) %o A363421 (Python) %o A363421 from sympy import divisor_count %o A363421 def A363421(n): return n**2-2*(n-1)*divisor_count(n)-1 if n else 1 # _Chai Wah Wu_, Jun 28 2023 %Y A363421 Cf. A000005, A113704, A363734, A363735. %K A363421 sign %O A363421 0,5 %A A363421 _Peter Luschny_, Jun 27 2023