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 A335021 #23 Jul 02 2022 01:52:19 %S A335021 0,0,0,-1,0,0,0,-2,1,0,0,-2,0,0,2,-3,0,0,0,-2,2,0,0,-4,1,0,2,-2,0,0,0, %T A335021 -4,2,0,2,-3,0,0,2,-4,0,0,0,-2,4,0,0,-6,1,0,2,-2,0,0,2,-4,2,0,0,-4,0, %U A335021 0,4,-5,2,0,0,-2,2,0,0,-6,0,0,4,-2,2,0,0,-6,3,0,0,-4,2,0,2,-4 %N A335021 a(n) = Sum_{d|n, 1 < d < n} (-1)^(d + 1). %C A335021 Number of odd nontrivial divisors of n minus number of even nontrivial divisors of n. %H A335021 David A. Corneth, <a href="/A335021/b335021.txt">Table of n, a(n) for n = 1..10000</a> %F A335021 G.f.: Sum_{k>=2} (-1)^(k + 1) * x^(2*k) / (1 - x^k). %F A335021 G.f.: - Sum_{k >= 2} x^(2*k)/(1 + x^k). - _Peter Bala_, Jan 12 2021 %F A335021 a(n) = A001227(n)*(1 - A007814(n)) - 1 + (-1)^n, if n > 1. - _Sebastian Karlsson_, Jan 14 2021 %t A335021 Table[DivisorSum[n, (-1)^(# + 1) &, 1 < # < n &], {n, 1, 88}] %t A335021 nmax = 88; CoefficientList[Series[Sum[(-1)^(k + 1) x^(2 k)/(1 - x^k), {k, 2, nmax}], {x, 0, nmax}], x] // Rest %o A335021 (PARI) a(n) = sumdiv(n, d, if ((d>1) && (d<n), (-1)^(d + 1))); \\ _Michel Marcus_, May 20 2020 %o A335021 (Python) %o A335021 from sympy import divisor_count %o A335021 def A335021(n): return 0 if n == 1 else (1-(m:=(~n & n-1).bit_length()))*divisor_count(n>>m)-((n&1)<<1) # _Chai Wah Wu_, Jul 01 2022 %Y A335021 Cf. A048272, A070824, A325937, A325939, A335022. %Y A335021 Cf. A001227, A007814. %K A335021 sign,easy %O A335021 1,8 %A A335021 _Ilya Gutkovskiy_, May 19 2020