login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

The limit of the string "0, 1" under the operation 'append first k terms, increment k' with k=2 initially.
5

%I #17 Nov 23 2024 19:37:55

%S 0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,

%T 1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,

%U 1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0

%N The limit of the string "0, 1" under the operation 'append first k terms, increment k' with k=2 initially.

%C An infinite binary word.

%C Sum of the first 10^n terms b(n) begins: 0, 4, 43, 440, 4344, 43826, 439780, 4344256, 43430906, 435183414, 4378550493.

%H Paolo Xausa, <a href="/A215532/b215532.txt">Table of n, a(n) for n = 0..10011</a>

%e 01 -> 0101 -> 0101 010 -> 0101010 0101 -> 01010100101 01010 etc.

%t Module[{k = 1}, Nest[Join[#, #[[;; ++k]]] &, {0, 1}, 15]] (* _Paolo Xausa_, Nov 23 2024 *)

%o (Python)

%o TOP = 1000

%o a = [0]*TOP

%o a[1] = 1

%o n = k = 2

%o while n+k < TOP:

%o a[n:] = a[:k]

%o n += k

%o k += 1

%o for k in range(n):

%o print(a[k], end=', ')

%Y Cf. A094186, A215531, A215530.

%K nonn,easy

%O 0

%A _Alex Ratushnyak_, Aug 15 2012