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 A326440 #28 Sep 08 2022 08:46:24 %S A326440 1,0,2,0,3,1,5,3,7,4,8,6,12,10,14,10,15,13,19,17,23,19,23,21,29,26,30, %T A326440 26,32,30,38,36,42,38,42,38,47,45,49,45,53,51,59,57,63,57,61,59,69,66, %U A326440 72,68,74,72,80,76,84,80,84,82,94,92,96,90,97,93,101,99 %N A326440 a(n) = 1 - tau(1) + tau(2) - tau(3) + ... + (-1)^n tau(n), where tau = A000005 is number of divisors. %C A326440 Is this sequence nonnegative? %C A326440 As tau(n) is odd when n is a square, there are alternating strings of even and odd integers with change of parity for each n square. Indeed, between m^2 and (m+1)^2-1, there is a string of 2m+1 even terms if m is odd, or a string of 2m+1 odd terms if m is even. - _Bernard Schott_, Jul 10 2019 %H A326440 Michel Marcus, <a href="/A326440/b326440.txt">Table of n, a(n) for n = 0..5000</a> %F A326440 a(n) = 1 + Sum_{k=1..n} (-1)^k A000005(k). %F A326440 For n > 0, a(n) = 1 + A307704(n). %F A326440 If p prime, a(p) = a(p-1) - 2. - _Bernard Schott_, Jul 10 2019 %e A326440 The first 6 terms of A000005 are 1, 2, 2, 3, 2, 4, so a(6) = 1 - 1 + 2 - 2 + 3 - 2 + 4 = 5. %t A326440 Accumulate[Table[If[k==0,1,(-1)^k*DivisorSigma[0,k]],{k,0,30}]] %o A326440 (PARI) a(n) = 1 - sum(k=1, n, (-1)^(k+1)*numdiv(k)); \\ _Michel Marcus_, Jul 09 2019 %o A326440 (Magma) [1] cat [1+(&+[(-1)^(k)*#Divisors(k):k in [1..n]]):n in [1..70]]; // _Marius A. Burtea_, Jul 10 2019 %Y A326440 Cf. A000005, A001222, A008683, A054519, A071321, A195017, A268387, A307704, A316523, A316524, A319273. %K A326440 nonn %O A326440 0,3 %A A326440 _Gus Wiseman_, Jul 06 2019