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.

A359400 Sum of positions of zeros in the reversed binary expansion of n, where positions in a sequence are read starting with 1 from the left.

This page as a plain text file.
%I A359400 #47 Mar 23 2024 20:26:12
%S A359400 1,0,1,0,3,2,1,0,6,5,4,3,3,2,1,0,10,9,8,7,7,6,5,4,6,5,4,3,3,2,1,0,15,
%T A359400 14,13,12,12,11,10,9,11,10,9,8,8,7,6,5,10,9,8,7,7,6,5,4,6,5,4,3,3,2,1,
%U A359400 0,21,20,19,18,18,17,16,15,17,16,15,14,14,13
%N A359400 Sum of positions of zeros in the reversed binary expansion of n, where positions in a sequence are read starting with 1 from the left.
%F A359400 a(n) = binomial(A029837(n)+1, 2) - A029931(n), for n>0.
%e A359400 The reversed binary expansion of 100 is (0,0,1,0,0,1,1), with zeros at positions {1,2,4,5}, so a(100) = 12.
%t A359400 Table[Total[Join@@Position[Reverse[IntegerDigits[n,2]],0]],{n,0,100}]
%o A359400 (C)
%o A359400 long A359400(long n) {
%o A359400   long result = 0, counter = 1;
%o A359400   do {
%o A359400     if (n % 2 == 0)
%o A359400       result += counter;
%o A359400     counter++;
%o A359400     n /= 2;
%o A359400   } while (n > 0);
%o A359400   return result; } // _Frank Hollstein_, Jan 06 2023
%o A359400 (Python)
%o A359400 def a(n): return sum(i for i, bi in enumerate(bin(n)[:1:-1], 1) if bi=='0')
%o A359400 print([a(n) for n in range(78)]) # _Michael S. Branicky_, Jan 09 2023
%Y A359400 The number of zeros is A023416, partial sums A059015.
%Y A359400 Row sums of A368494.
%Y A359400 For positions of 1's we have A029931, non-reversed A230877.
%Y A359400 The non-reversed version is A359359.
%Y A359400 A003714 lists numbers with no successive binary indices.
%Y A359400 A030190 gives binary expansion, reverse A030308.
%Y A359400 A039004 lists the positions of zeros in A345927.
%Y A359400 Cf. A000120, A048793, A069010, A070939, A073642, A328594, A328595, A344618, A359402, A359495.
%K A359400 nonn,base
%O A359400 0,5
%A A359400 _Gus Wiseman_, Jan 05 2023