OFFSET
0,3
COMMENTS
There are two distinct limiting words generated by s(0) = 0, s(1) = 12, s(n) = s(n - 2)s(n - 1). This one is given by s(2n) for n>=0; the other, given by s(2n-1) for n>=0, is 1201201212012... In both limiting words, the length of the n-th initial subword is A000045(n+1), for n>=1.
EXAMPLE
Initial subwords: s(0)=0, s(1)=12, s(2)=012, s(3)=12012, s(4)= 01212012, of lengths 1, 2, 3, 5, 8 (Fibonacci numbers).
MATHEMATICA
s[0] = "0"; s[1] = "12"; s[n_] := StringJoin[s[n - 2], s[n - 1]];
Join[{0}, IntegerDigits[FromDigits[s[10]]]]
PROG
(Python)
from math import isqrt
def A047924(n): return ((m:=(n+isqrt(5*n**2)>>1)+1)+isqrt(5*m**2)>>1)+m+1
def A026356(n): return (n+1+isqrt(5*(n-1)**2)>>1)+n
def A383671(n):
def bsearch(f, n):
kmin, kmax = 0, 1
while f(kmax) <= n:
kmax <<= 1
kmin = kmax>>1
while True:
kmid = kmax+kmin>>1
if f(kmid) > n:
kmax = kmid
else:
kmin = kmid
if kmax-kmin <= 1:
break
return kmin
if n<3: return n
if f(bsearch(f, n+1))==n+1: return i
return 2 # Chai Wah Wu, May 21 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 15 2025
STATUS
approved
