login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A362240 Triangle read by rows: Row n is the shortest, then lexicographically earliest sequence of 0s and 1s not yet in the sequence. 6
0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1
COMMENTS
Bit strings as indexed by A362009.
Shortest then lexicographically earliest ordering for rows is as in A076478.
LINKS
Samuel Harkness, Table of n, a(n) for n = 1..10008 (first 911 rows flattened)
Samuel Harkness, MATLAB program
EXAMPLE
The triangle begins:
n row(n)
--- ------
1 0;
2 1;
3 0, 0;
4 1, 1;
5 0, 0, 0;
6 1, 0, 1;
7 1, 1, 1;
8 0, 0, 0, 0;
9 1, 0, 1, 0;
10 1, 1, 0, 1;
11 0, 0, 0, 0, 0;
12 0, 0, 0, 1, 1;
13 0, 0, 1, 0, 0;
For row 6, we know that all binary sequences up to row 5 = {0, 0, 0} appear, so we first check {0, 0, 1}. This sequence appears at {a(3), a(4), a(5)} (using parts of rows 3 and 4).
Next, check {0, 1, 0}. This sequence appears at {a(1), a(2), a(3)} (using parts of rows 1, 2, and 3).
Next, check {0, 1, 1}. This sequence appears at {a(4), a(5), a(6)} (using parts of rows 3 and 4).
Next, check {1, 0, 0}. This sequence appears at {a(2), a(3), a(4)} (using parts of rows 2 and 3).
Next, check {1, 0, 1}. This sequence does not appear anywhere in the sequence, so row 6 of the triangle is {1, 0, 1}.
MATHEMATICA
V = {0}; K = {0}; While[Length@K <= 87, y = 0; While[y == 0, i = Length@V; V[[i]]++; While[V[[i]] == 2 && i > 1 , V[[i]] = 0; i--; V[[i]]++]; If[V[[1]] == 2, V = ConstantArray[0, Length@V + 1]]; z = 0; For[a = 1, a <= Length@K - Length@V + 1, a++, If[K[[a ;; a + Length@V - 1]] == V, z = 1; Break[]]]; If[z == 0, AppendTo[K, V]; K = Flatten[K]; y = 1]]]; Print[K[[1 ;; 87]]]
PROG
(MATLAB) See Links section.
(Python)
from itertools import chain, count, islice, product
def bins(): yield from ("".join(b) for d in count(1) for b in product("01", repeat=d))
def agen(s=""): yield from chain.from_iterable(map(int, t) for t in bins() if t not in s and (s:=s+t))
print(list(islice(agen(), 87))) # Michael S. Branicky, Apr 12 2023
CROSSREFS
Cf. A076478, A362009, A362241 (rows interpreted as binary).
Sequence in context: A079944 A059652 A108736 * A079813 A078580 A059651
KEYWORD
nonn,tabf
AUTHOR
Samuel Harkness, Apr 12 2023
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 28 06:27 EDT 2024. Contains 372020 sequences. (Running on oeis4.)