This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A284749 #37 Jul 16 2025 12:10:17 %S A284749 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, %T A284749 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, %U A284749 0,1,2,2,0,1,2,0,1,2,2,0,1,2,2,0,1,2 %N A284749 {001->2}-transform of the infinite Fibonacci word A003849. %C A284749 From _Daniel Rust_, Aug 18 2018: (Start) %C A284749 This word is the fixed point of the morphism 0->2, 1->01, 2->2201 with the finite string 0, 1, 2, 0, 1 appended to the beginning. This morphism comes from taking the 'proper' version of the Fibonacci morphism 0->01, 1->1, given by 0->001, 1->01 (A189661 but with the rightmost 0 moved to the left of each image word), then replacing 001 with 2 and noting that the new symbol 2 should map to 00100101 = 2201 in order to be consistent. %C A284749 The finite string appended to the beginning comes from the process of finding a proper version of the Fibonacci morphism using a return word encoding and taking conjugates which causes a shift of the respective fixed points. %C A284749 (End) %C A284749 This sequence is the unique fixed point of the morphism 0->01, 1->2, 2->0122. See the paragraph following Lemma 23 in the paper by Allouche and me. - _Michel Dekking_, Oct 05 2018 %H A284749 Clark Kimberling, <a href="/A284749/b284749.txt">Table of n, a(n) for n = 1..10000</a> %H A284749 J.-P. Allouche and F. M. Dekking, <a href="https://arxiv.org/abs/1809.03424">Generalized Beatty sequences and complementary triples</a>, arXiv:1809.03424v3 [math.NT], 2018-2019. %e A284749 As a word, A003849 = 01001010010010100..., and replacing each 001 by 2 gives 01201220120... %t A284749 s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13] (* A003849 *) %t A284749 w = StringJoin[Map[ToString, s]] %t A284749 w1 = StringReplace[w, {"001" -> "2"}] %t A284749 st = ToCharacterCode[w1] - 48 (* A284749 *) %t A284749 Flatten[Position[st, 0]] (* A214971 *) %t A284749 Flatten[Position[st, 1]] (* A284624 *) %t A284749 Flatten[Position[st, 2]] (* A284625 *) %o A284749 (Python) %o A284749 from math import isqrt %o A284749 def A284624(n): return (n<<1)+(n-1+isqrt(5*(n-1)**2)>>1) %o A284749 def A284625(n): return (n+isqrt(5*n**2)&-2)-n+2 %o A284749 def A284749(n): %o A284749 def bsearch(f, n): %o A284749 kmin, kmax = 0, 1 %o A284749 while f(kmax) <= n: %o A284749 kmax <<= 1 %o A284749 kmin = kmax>>1 %o A284749 while True: %o A284749 kmid = kmax+kmin>>1 %o A284749 if f(kmid) > n: %o A284749 kmax = kmid %o A284749 else: %o A284749 kmin = kmid %o A284749 if kmax-kmin <= 1: %o A284749 break %o A284749 return kmin %o A284749 for i, f in enumerate((A284624, A284625),1): %o A284749 if f(bsearch(f,n))==n: return i %o A284749 return 0 # _Chai Wah Wu_, May 22 2025 %Y A284749 Cf. A003849, A214971, A284624, A284625. %K A284749 nonn,easy %O A284749 1,3 %A A284749 _Clark Kimberling_, May 02 2017