login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245562 Table read by rows: row n gives list of lengths of runs of 1's in binary expansion of n, starting with high-order bits. 12
0, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 2, 1, 2, 2, 3, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 3, 1, 4, 2, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

A formula for A071053(n) depends on this table.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..2770

N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168, 2015

EXAMPLE

Here are the run lengths for the numbers 0 through 21:

0, []

1, [1]

2, [1]

3, [2]

4, [1]

5, [1, 1]

6, [2]

7, [3]

8, [1]

9, [1, 1]

10, [1, 1]

11, [1, 2]

12, [2]

13, [2, 1]

14, [3]

15, [4]

16, [1]

17, [1, 1]

18, [1, 1]

19, [1, 2]

20, [1, 1]

21, [1, 1, 1]

MAPLE

for n from 0 to 128 do

lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;

for i from 1 to L1 do

   if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;

   elif out1 = 0 and t1[i] = 1 then c:=c+1;

   elif out1 = 1 and t1[i] = 0 then c:=c;

   elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;

   fi;

   if i = L1 and c>0 then lis:=[c, op(lis)]; fi;

                   od:

lprint(n, lis);

od:

PROG

(Python)

from re import split

A245562_list = [0]

for n in range(1, 100):

....A245562_list.extend(len(d) for d in split('0+', bin(n)[2:]) if d != '')

# Chai Wah Wu, Sep 07 2014

(PARI) row(n)=my(v=List(), k); while(n, n>>=valuation(n, 2); listput(v, k=valuation(n+1, 2)); n>>=k); Vecrev(v) \\ Charles R Greathouse IV, Oct 21 2016

CROSSREFS

Row sums = A000120 (the binary weight).

Cf. A245563, A071053.

Sequence in context: A243005 A058393 A131256 * A304495 A175069 A245563

Adjacent sequences:  A245559 A245560 A245561 * A245563 A245564 A245565

KEYWORD

nonn,base,tabf,easy

AUTHOR

N. J. A. Sloane, Aug 10 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 19 11:36 EDT 2018. Contains 316359 sequences. (Running on oeis4.)