A001387 The binary "look and say" sequence.
1, 11, 101, 111011, 11110101, 100110111011, 111001011011110101, 111100111010110100110111011, 100110011110111010110111001011011110101, 1110010110010011011110111010110111100111010110100110111011
Offset: 1
Examples
To get the 5th term, for example, note that 4th term has three (11 in binary!) 1's, one (1) 0 and two (10) 1's, giving 11 1 1 0 10 1.
Links
- John Cerkan, Table of n, a(n) for n = 1..17
- J. H. Conway, The weird and wonderful chemistry of audioactive decay, Eureka 46 (1986) 5-16, reprinted in: Open Problems in Communications and Computations, Springer, 1987, 173-188.
- Nathaniel Johnston, The Binary "Look-and-Say" Sequence
- Thomas Morrill, Look, Knave, arXiv:2004.06414 [math.CO], 2020.
- Torsten Sillke, The binary form of Conway's sequence
Programs
-
Mathematica
a[1] := 1; a[n_] := a[n] = FromDigits[Flatten[{IntegerDigits[Length[#],2], First[#]}& /@ Split[IntegerDigits[a[n-1]]]]]; Map[a, Range[20]] (* Peter J. C. Moses, Mar 24 2013 *) Nest[Append[#, FromDigits@ Flatten@ Map[Reverse /@ IntegerDigits[Tally@ #, 2] &, Split@ IntegerDigits@ Last@ #]] &, {1}, 9] (* Michael De Vlieger, Dec 12 2017 *)
-
Python
from itertools import accumulate, groupby, repeat def summarize(n, _): return int("".join(bin(len(list(g)))[2:]+k for k, g in groupby(str(n)))) def aupto(terms): return list(accumulate(repeat(1, terms), summarize)) print(aupto(11)) # Michael S. Branicky, Sep 18 2022
Extensions
New name from Andrey Zabolotskiy, Dec 13 2017
Comments