login
Binary encoding of the rows of A362240.
3

%I #27 May 08 2023 02:28:26

%S 0,1,0,3,0,5,7,0,10,13,0,3,4,7,14,31,4,9,13,15,17,20,27,28,37,44,51,

%T 53,63,2,15,17,20,28,31,41,44,46,48,53,58,71,78,99,101,123,2,5,7,11,

%U 17,19,24,35,39,41,55,58,63,72,83,85,89,97,107,111,113,134

%N Binary encoding of the rows of A362240.

%H Neal Gersh Tolunsky, <a href="/A362241/b362241.txt">Table of n, a(n) for n = 1..10000</a>

%H Samuel Harkness, <a href="/A362241/a362241.m.txt">MATLAB program</a>

%H Neal Gersh Tolunsky, <a href="/A362241/a362241.png">Scatterplot of a(n) for n = 1..5196</a>

%F a(n) = A053645(A362009(n) + 1).

%e The sequence begins:

%e n a(n) A362240 row

%e --- ---- -----------

%e 1 0 0;

%e 2 1 1;

%e 3 0 0, 0;

%e 4 3 1, 1;

%e 5 0 0, 0, 0;

%e 6 5 1, 0, 1;

%e 7 7 1, 1, 1;

%e 8 0 0, 0, 0, 0;

%e 9 10 1, 0, 1, 0;

%e 10 13 1, 1, 0, 1;

%e 11 0 0, 0, 0, 0, 0;

%e 12 3 0, 0, 0, 1, 1;

%e 13 4 0, 0, 1, 0, 0;

%t 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]

%o (MATLAB) See Links section.

%o (Python)

%o from itertools import count, islice, product

%o def bins(): yield from ("".join(b) for d in count(1) for b in product("01", repeat=d))

%o def agen(s=""): yield from (int(t, 2) for t in bins() if t not in s and (s:=s+t))

%o print(list(islice(agen(), 68))) # _Michael S. Branicky_, Apr 12 2023

%Y Cf. A362240, A053645, A362009, A118248.

%K nonn,base

%O 1,4

%A _Samuel Harkness_, Apr 12 2023