OFFSET
1,4
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Samuel Harkness, MATLAB program
Neal Gersh Tolunsky, Scatterplot of a(n) for n = 1..5196
EXAMPLE
The sequence begins:
n a(n) A362240 row
--- ---- -----------
1 0 0;
2 1 1;
3 0 0, 0;
4 3 1, 1;
5 0 0, 0, 0;
6 5 1, 0, 1;
7 7 1, 1, 1;
8 0 0, 0, 0, 0;
9 10 1, 0, 1, 0;
10 13 1, 1, 0, 1;
11 0 0, 0, 0, 0, 0;
12 3 0, 0, 0, 1, 1;
13 4 0, 0, 1, 0, 0;
MATHEMATICA
V = {0}; K = {0}; B = {0}; While[Length@B < 68, 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]; b = 0; For[c = Length@V, c > 0, c--, b += V[[c]]*2^(Length@V - c)]; AppendTo[B, b]; K = Flatten[K]; y = 1]]]; Print[B]
PROG
(MATLAB) See Links section.
(Python)
from itertools import 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 (int(t, 2) for t in bins() if t not in s and (s:=s+t))
print(list(islice(agen(), 68))) # Michael S. Branicky, Apr 12 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Samuel Harkness, Apr 12 2023
STATUS
approved