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 A096271 #36 Jan 11 2023 06:39:43 %S A096271 0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,2,0,1, %T A096271 0,2,0,1,0,0,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,0,0,1,0,2, %U A096271 0,1,0,0,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,2,0,1,0,2,0,1,0,0,0 %N A096271 Ternary sequence that is a fixed point of the morphism 0 -> 01, 1 -> 02, 2 -> 00. %H A096271 Antti Karttunen, <a href="/A096271/b096271.txt">Table of n, a(n) for n = 0..65537</a> %H A096271 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>. %F A096271 Recurrence: a(2n) = 0, a(2n+1) = (a(n)+1) mod 3. - _Ralf Stephan_, Dec 11 2004 %F A096271 a(n) = A007814(n+1) mod 3. - _Gabriele Fici_, Mar 28 2019 %F A096271 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4/7. - _Amiram Eldar_, Jan 11 2023 %t A096271 Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {0, 2}, 2 -> {0, 0}})]}], {0}, 7] (* _Robert G. Wilson v_, Feb 26 2005 *) %o A096271 (PARI) map(d)=if(d==2,[0,0],if(d==1,[0,2],[0,1])) %o A096271 {m=53;v=[];w=[0];while(v!=w,v=w;w=[];for(n=1,min(m,length(v)),w=concat(w,map(v[n]))));for(n=1,2*m,print1(v[n],","))} \\ _Klaus Brockhaus_, Jun 23 2004 %o A096271 (PARI) A096271(n) = if(!(n%2),0,(1+A096271((n-1)/2))%3); \\ _Antti Karttunen_, Nov 01 2018 %o A096271 (Python) %o A096271 def A096271(n): return (~(n+1) & n).bit_length()%3 # _Chai Wah Wu_, Jan 09 2023 %Y A096271 Cf. A007814, A071858. %K A096271 nonn,easy %O A096271 0,4 %A A096271 _N. J. A. Sloane_, Jun 23 2004 %E A096271 More terms from _Klaus Brockhaus_, Jun 23 2004