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.

A163510 Irregular table read by rows: Write n in binary. For each 1, the m-th term of row n is the number of 0's between the m-th 1, reading right to left, and the (m-1)th 1 (or the right side of the number if m-1 = 0).

This page as a plain text file.
%I A163510 #34 Jul 17 2023 13:18:40
%S A163510 0,1,0,0,2,0,1,1,0,0,0,0,3,0,2,1,1,0,0,1,2,0,0,1,0,1,0,0,0,0,0,0,4,0,
%T A163510 3,1,2,0,0,2,2,1,0,1,1,1,0,1,0,0,0,1,3,0,0,2,0,1,1,0,0,0,1,0,2,0,0,0,
%U A163510 1,0,0,1,0,0,0,0,0,0,0,0,5,0,4,1,3,0,0,3,2,2,0,1,2,1,0,2,0,0,0,2,3,1,0,2,1,1,1,1,0,0,1,1,2,0,1,0,1,0,1,1,0,0,1
%N A163510 Irregular table read by rows: Write n in binary. For each 1, the m-th term of row n is the number of 0's between the m-th 1, reading right to left, and the (m-1)th 1 (or the right side of the number if m-1 = 0).
%C A163510 Row n contains exactly A000120(n) terms, for each n.
%C A163510 All odd-numbered rows begin with 0. All even-numbered rows begin with a positive integer.
%C A163510 Can be used to compute the permutation A163511.
%H A163510 Antti Karttunen, <a href="/A163510/b163510.txt">Table of n, a(n) for n = 1..11265</a>
%F A163510 a(n) = A227186(A006068(A100922(n-1)), A243067(n)) - 1. - _Antti Karttunen_, Jun 19 2014
%e A163510 Table begins as:
%e A163510   Row  n in    Terms on
%e A163510    n   binary  that row
%e A163510    1      1    0; (the distance of 1-bit from the right edge is zero)
%e A163510    2     10    1; (the distance of 1-bit from the right edge is one)
%e A163510    3     11    0,0;
%e A163510    4    100    2;
%e A163510    5    101    0,1; (the least significant 1-bit is zero steps away from the right edge, and there is one zero between those two 1-bits)
%e A163510    6    110    1,0;
%e A163510    7    111    0,0,0;
%e A163510    8   1000    3;
%e A163510    9   1001    0,2;
%e A163510   10   1010    1,1;
%e A163510   11   1011    0,0,1;
%e A163510   12   1100    2,0;
%e A163510   13   1101    0,1,0;
%e A163510   14   1110    1,0,0;
%e A163510   15   1111    0,0,0,0;
%e A163510   16  10000    4;
%t A163510 Table[Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]], {n, 46}] // Flatten (* _Michael De Vlieger_, Jul 25 2016 *)
%o A163510 (Scheme) (define (A163510 n) (- (A227186bi (A006068 (A100922 (- n 1))) (A243067 n)) 1))
%o A163510 ;; See A227186 for A227186bi. - _Antti Karttunen_, Jun 19 2014
%o A163510 (Python)
%o A163510 from itertools import count, islice
%o A163510 def A163510_gen(): # generator of terms
%o A163510     for n in count(1):
%o A163510         k = n
%o A163510         while k:
%o A163510             yield (s:=(~k&k-1).bit_length())
%o A163510             k >>= s+1
%o A163510 A163510_list = list(islice(A163510_gen(),30)) # _Chai Wah Wu_, Jul 17 2023
%Y A163510 Cf. A000120, A006068, A100922, A227186, A243067, A163511, A227736.
%Y A163510 Equals A228351-1, termwise.
%K A163510 base,nonn,tabf
%O A163510 1,5
%A A163510 _Leroy Quet_, Jul 29 2009
%E A163510 Additional terms computed and Example section added by _Antti Karttunen_, Jun 19 2014