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 A345927 #17 Jul 20 2021 03:30:45 %S A345927 0,1,1,0,1,2,0,1,1,0,2,1,0,-1,1,0,1,2,0,1,2,3,1,2,0,1,-1,0,1,2,0,1,1, %T A345927 0,2,1,0,-1,1,0,2,1,3,2,1,0,2,1,0,-1,1,0,-1,-2,0,-1,1,0,2,1,0,-1,1,0, %U A345927 1,2,0,1,2,3,1,2,0,1,-1,0,1,2,0,1,2,3,1,2 %N A345927 Alternating sum of the binary expansion of n (row n of A030190). Replace 2^k with (-1)^(A070939(n)-k) in the binary expansion of n (compare to the definition of A065359). %C A345927 The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. %F A345927 a(n) = (-1)^(A070939(n)-1)*A065359(n). %e A345927 The binary expansion of 53 is (1,1,0,1,0,1), so a(53) = 1 - 1 + 0 - 1 + 0 - 1 = -2. %t A345927 ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}]; %t A345927 Table[ats[IntegerDigits[n,2]],{n,0,100}] %o A345927 (PARI) a(n) = subst(Pol(Vecrev(binary(n))), x, -1); \\ _Michel Marcus_, Jul 19 2021 %o A345927 (Python) %o A345927 def a(n): return sum((-1)**k for k, bi in enumerate(bin(n)[2:]) if bi=='1') %o A345927 print([a(n) for n in range(84)]) # _Michael S. Branicky_, Jul 19 2021 %Y A345927 Binary expansions of each nonnegative integer are the rows of A030190. %Y A345927 The positions of 0's are A039004. %Y A345927 The version for prime factors is A071321 (reverse: A071322). %Y A345927 Positions of first appearances are A086893. %Y A345927 The version for standard compositions is A124754 (reverse: A344618). %Y A345927 The version for prime multiplicities is A316523. %Y A345927 The version for prime indices is A316524 (reverse: A344616). %Y A345927 A003714 lists numbers with no successive binary indices. %Y A345927 A070939 gives the length of an integer's binary expansion. %Y A345927 A103919 counts partitions by sum and alternating sum. %Y A345927 A328594 lists numbers whose binary expansion is aperiodic. %Y A345927 A328595 lists numbers whose reversed binary expansion is a necklace. %Y A345927 Cf. A000037, A000070, A000120, A027187, A028260, A065359, A069010, A116406, A121016, A191232, A245563, A344609, A344619. %K A345927 sign %O A345927 0,6 %A A345927 _Gus Wiseman_, Jul 14 2021