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 A091297 #65 Nov 29 2024 05:41:25 %S A091297 0,2,1,1,0,2,0,2,0,2,1,1,0,2,1,1,0,2,1,1,0,2,0,2,0,2,1,1,0,2,0,2,0,2, %T A091297 1,1,0,2,0,2,0,2,1,1,0,2,1,1,0,2,1,1,0,2,0,2,0,2,1,1,0,2,1,1,0,2,1,1, %U A091297 0,2,0,2,0,2,1,1,0,2,1,1,0,2,1,1,0,2,0,2,0,2,1,1,0,2,0,2,0,2,1,1,0,2,0,2,0 %N A091297 A fixed point of the morphism 0 -> 02, 1 -> 02, 2 -> 11, starting from 0. %C A091297 To construct the sequence: start from the Feigenbaum sequence A035263 = 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, ..., then change 1 -> 0, 2 and 0 -> 1, 1. - _Philippe Deléham_, Apr 18 2004 %C A091297 This Feigenbaum interpretation is equivalent to writing n+1 = binary "...1 00..00 x" where x is the least significant bit and zero or more 0's. If an odd number of 0's then a(n) = 1, otherwise a(n) = 2*x. In a similar way, if n-1 = binary "...0 11..11 x" with an odd number of 1's then a(n)=1 and otherwise a(n) = 2*x. - _Kevin Ryde_, Oct 17 2020 %C A091297 From _Mikhail Kurkov_, Mar 25 2021: (Start) %C A091297 This sequence can be represented as a binary tree. Each child to the right is obtained by applying mex to the parent, and each child to the left is obtained by applying mex to the set formed by the parent and its second child: %C A091297 ( ) %C A091297 | %C A091297 ...................0................... %C A091297 2 1 %C A091297 1......../ \........0 2......../ \........0 %C A091297 / \ / \ / \ / \ %C A091297 / \ / \ / \ / \ %C A091297 / \ / \ / \ / \ %C A091297 2 0 2 1 1 0 2 1 %C A091297 1 0 2 1 1 0 2 0 2 0 2 1 1 0 2 0 %C A091297 etc. %C A091297 Here mex means smallest nonnegative missing number. %C A091297 Each parent and its two children form a set {0,1,2}. (End) %H A091297 Mikhail Kurkov, <a href="/A091297/b091297.txt">Table of n, a(n) for n = 1..8192</a> %H A091297 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A091297 a(n) = 0 iff n = A079523(k), a(n) = 1 iff n = A081706(2*k) or n = 1 + A081706(2*k), a(n) = 2 iff n = A036554(k). %F A091297 a(2*n-1) + a(2*n) = 2. %F A091297 a(2*n-1) = (A065037(2*n+1) - A065037(2*n-1) - 2)/2. %F A091297 From _Mikhail Kurkov_, Oct 10 2020: (Start) %F A091297 a(2^m-1) = 1 - m mod 2, m > 0, %F A091297 a(2^m) = 1 + m mod 2, m > 0, %F A091297 a(2^m+k) = a(k) for 0 < k < 2^m-1, m > 1. %F A091297 a(2^m-k) = 2 - a(k-1) for 1 < k <= 2^(m-1), m > 1. (End) %F A091297 a(2n+1) = mex{a(n)}, a(2n) = mex{a(n),a(2n+1)} or a(2n+1) = [a(n)=0], a(2n) = 2 - [a(n)=2] for n > 0 with a(1) = 0. - _Mikhail Kurkov_, Mar 25 2021 %t A091297 Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 2}, 1 -> {0, 2}, 2 -> {1, 1}}) ]}], {0}, 7] (* _Robert G. Wilson v_, Mar 03 2005 *) %o A091297 (PARI) a(n)={while(1, my(m=logint(n,2)); if(n==2*2^m-1, return(m%2)); if(n==2^m, return(1 + m%2)); n-=2^m)} \\ _Andrew Howroyd_, Oct 17 2020 %o A091297 (PARI) a(n) = n++; my(k=valuation(n>>1,2)); if(k%2==1, 1, 2*(n%2)); \\ _Kevin Ryde_, Oct 17 2020 %Y A091297 Cf. A036554, A065037, A079523, A081706. %K A091297 easy,nonn %O A091297 1,2 %A A091297 _Philippe Deléham_, Feb 24 2004 %E A091297 More terms from _Robert G. Wilson v_, Mar 03 2005