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.

A227736 Irregular table read by rows: the first entry of n-th row is length of run of rightmost identical bits (either 0 or 1, equal to n mod 2), followed by length of the next run of bits, etc., in the binary representation of n, when scanned from the least significant to the most significant end.

This page as a plain text file.
%I A227736 #73 Aug 21 2025 08:39:17
%S A227736 1,1,1,2,2,1,1,1,1,1,2,3,3,1,1,2,1,1,1,1,1,2,1,1,2,2,1,1,2,1,3,4,4,1,
%T A227736 1,3,1,1,1,2,1,2,2,1,2,1,1,1,1,1,1,1,1,1,2,1,1,3,1,1,3,2,1,2,2,1,1,1,
%U A227736 2,2,1,2,2,3,1,1,3,1,4,5,5,1,1,4,1,1,1,3,1
%N A227736 Irregular table read by rows: the first entry of n-th row is length of run of rightmost identical bits (either 0 or 1, equal to n mod 2), followed by length of the next run of bits, etc., in the binary representation of n, when scanned from the least significant to the most significant end.
%C A227736 Row n has A005811(n) terms. In rows 2^(k-1)..2^k-1 we have all the compositions (ordered partitions) of k. Other orderings of compositions: A101211 (same with rows reversed), A066099, A108244 and A124734.
%C A227736 Each row n >= 1 contains the initial A005811(n) nonzero terms from the beginning of row n of A227186. A070939(n) gives the sum of terms on row n, while A167489(n) gives the product of its terms. A136480 gives the first column. A101211 lists the terms of each row in reverse order.
%H A227736 Antti Karttunen, <a href="/A227736/b227736.txt">The rows 1..1023 of the table, flattened</a>
%H A227736 Mikhail Kurkov, <a href="/A227736/a227736_1.txt">Comments on A227736</a>.
%H A227736 Claude Lenormand, <a href="/A318921/a318921.pdf">Deux transformations sur les mots</a>, Preprint, 5 pages, Nov 17 2003. Apparently unpublished. This is a scanned copy of the version that the author sent to me in 2003. - _N. J. A. Sloane_, Sep 09 2018. See Procedure 1.
%F A227736 a(n) = A227186(A227737(n), A227740(n)).
%F A227736 a(n) = A101211(A227741(n)).
%e A227736 Table begins as:
%e A227736   Row  n in    Terms on
%e A227736    n   binary  that row
%e A227736    1      1    1;
%e A227736    2     10    1,1;
%e A227736    3     11    2;
%e A227736    4    100    2,1;
%e A227736    5    101    1,1,1;
%e A227736    6    110    1,2;
%e A227736    7    111    3;
%e A227736    8   1000    3,1;
%e A227736    9   1001    1,2,1;
%e A227736   10   1010    1,1,1,1;
%e A227736   11   1011    2,1,1;
%e A227736   12   1100    2,2;
%e A227736   13   1101    1,1,2;
%e A227736   14   1110    1,3;
%e A227736   15   1111    4;
%e A227736   16  10000    4,1;
%e A227736 etc. with the terms of row n appearing in reverse order compared how the runs of the same length appear in the binary expansion of n (Cf. A101211).
%e A227736 From _Omar E. Pol_, Sep 08 2013: (Start)
%e A227736 Illustration of initial terms:
%e A227736   ---------------------------------------
%e A227736   k   m     Diagram        Composition
%e A227736   ---------------------------------------
%e A227736   .          _
%e A227736   1   1     |_|_           1;
%e A227736   2   1     |_| |          1, 1,
%e A227736   2   2     |_ _|_         2;
%e A227736   3   1     |_  | |        2, 1,
%e A227736   3   2     |_|_| |        1, 1, 1,
%e A227736   3   3     |_|   |        1, 2,
%e A227736   3   4     |_ _ _|_       3;
%e A227736   4   1     |_    | |      3, 1,
%e A227736   4   2     |_|_  | |      1, 2, 1,
%e A227736   4   3     |_| | | |      1, 1, 1, 1,
%e A227736   4   4     |_ _|_| |      2, 1, 1,
%e A227736   4   5     |_  |   |      2, 2,
%e A227736   4   6     |_|_|   |      1, 1, 2,
%e A227736   4   7     |_|     |      1, 3,
%e A227736   4   8     |_ _ _ _|_     4;
%e A227736   5   1     |_      | |    4, 1,
%e A227736   5   2     |_|_    | |    1, 3, 1,
%e A227736   5   3     |_| |   | |    1, 1, 2, 1,
%e A227736   5   4     |_ _|_  | |    2, 2, 1,
%e A227736   5   5     |_  | | | |    2, 1, 1, 1,
%e A227736   5   6     |_|_| | | |    1, 1, 1, 1, 1,
%e A227736   5   7     |_|   | | |    1, 2, 1, 1,
%e A227736   5   8     |_ _ _|_| |    3, 1, 1,
%e A227736   5   9     |_    |   |    3, 2,
%e A227736   5  10     |_|_  |   |    1, 2, 2,
%e A227736   5  11     |_| | |   |    1, 1, 1, 2,
%e A227736   5  12     |_ _|_|   |    2, 1, 2,
%e A227736   5  13     |_  |     |    2, 3,
%e A227736   5  14     |_|_|     |    1, 1, 3,
%e A227736   5  15     |_|       |    1, 4,
%e A227736   5  16     |_ _ _ _ _|    5;
%e A227736 .
%e A227736 Also irregular triangle read by rows in which row k lists the compositions of k, k >= 1.
%e A227736 Triangle begins:
%e A227736  [1];
%e A227736  [1,1], [2];
%e A227736  [2,1], [1,1,1], [1,2],[3];
%e A227736  [3,1], [1,2,1], [1,1,1,1], [2,1,1], [2,2], [1,1,2], [1,3], [4];
%e A227736  [4,1], [1,3,1], [1,1,2,1], [2,2,1], [2,1,1,1], [1,1,1,1,1], [1,2,1,1], [3,1,1], [3,2], [1,2,2], [1,1,1,2], [2,1,2], [2,3], [1,1,3], [1,4], [5];
%e A227736 Row k has length A001792(k-1).
%e A227736 Row sums give A001787(k), k >= 1.
%e A227736 (End)
%t A227736 Array[Length /@ Reverse@ Split@ IntegerDigits[#, 2] &, 34] // Flatten (* _Michael De Vlieger_, Dec 11 2020 *)
%o A227736 (Scheme) (define (A227736 n) (A227186bi (A227737 n) (A227740 n))) ;; The Scheme-function for A227186bi has been given in A227186.
%o A227736 (Haskell)
%o A227736 import Data.List (group)
%o A227736 a227736 n k = a227736_tabf !! (n-1) !! (k-1)
%o A227736 a227736_row n = a227736_tabf !! (n-1)
%o A227736 a227736_tabf = map (map length . group) $ tail a030308_tabf
%o A227736 -- _Reinhard Zumkeller_, Aug 11 2014
%o A227736 (PARI) apply( {A227736_row(n, r=[1], b=n%2)=while(n\=2, n%2==b && r[#r]++ || [b=1-b, r=concat(r,1)]); r}, [1..22]) \\ _M. F. Hasler_, Mar 11 2025
%o A227736 (Python)
%o A227736 def A227736_row(n): return[len(list(g))for _,g in groupby(bin(n)[:1:-1])]
%o A227736 from itertools import groupby # _M. F. Hasler_, Mar 11 2025
%Y A227736 Cf. A227738 and also A227739 for similar table for unordered partitions.
%Y A227736 Cf. A030308, A245562, A245563.
%Y A227736 Cf. A101211 (rows in reversed order).
%K A227736 nonn,base,tabf,changed
%O A227736 1,4
%A A227736 _Antti Karttunen_, Jul 25 2013