A284749 {001->2}-transform of the infinite Fibonacci word A003849.
0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 2, 2, 0, 1, 2
Offset: 1
Examples
As a word, A003849 = 01001010010010100..., and replacing each 001 by 2 gives 01201220120...
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
- J.-P. Allouche and F. M. Dekking, Generalized Beatty sequences and complementary triples, arXiv:1809.03424v3 [math.NT], 2018-2019.
Programs
-
Mathematica
s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13] (* A003849 *) w = StringJoin[Map[ToString, s]] w1 = StringReplace[w, {"001" -> "2"}] st = ToCharacterCode[w1] - 48 (* A284749 *) Flatten[Position[st, 0]] (* A214971 *) Flatten[Position[st, 1]] (* A284624 *) Flatten[Position[st, 2]] (* A284625 *)
-
Python
from math import isqrt def A284624(n): return (n<<1)+(n-1+isqrt(5*(n-1)**2)>>1) def A284625(n): return (n+isqrt(5*n**2)&-2)-n+2 def A284749(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 for i, f in enumerate((A284624, A284625),1): if f(bsearch(f,n))==n: return i return 0 # Chai Wah Wu, May 22 2025
Comments