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 A006996 M0021 #50 Jun 27 2025 01:02:55 %S A006996 1,2,0,2,1,0,0,0,0,2,1,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,1,2,0,0, %T A006996 0,0,1,2,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, %U A006996 0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,1,2,0,0,0,0,1,2,0,2,1,0,0,0,0,0,0,0,0,0,0 %N A006996 a(n) = C(2n,n) mod 3. %C A006996 Removing 0's from the sequence gives Thue-Morse sequence A001285 : 1,2,0,2,1,0,0,0,0,2,1,0,1,2,..->1,2,2,1,2,1,1,2,... - _Benoit Cloitre_, Jan 04 2004 %C A006996 a(n) = 0 if n in A074940, a(n) = 1 if n in A074939, a(n) = 2 if n in A074938. %C A006996 Central terms of the triangle in A083093. - _Reinhard Zumkeller_, Jul 11 2013 %D A006996 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006996 Reinhard Zumkeller, <a href="/A006996/b006996.txt">Table of n, a(n) for n = 0..2187=3^7</a> %H A006996 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a> %H A006996 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A006996 a(n) = A000984(n) mod 3. %F A006996 a(n) = A005704(n) mod 3. - _Benoit Cloitre_, Jan 04 2004 %F A006996 A fixed point of the morphism : 1 -> 120, 2 -> 210, 0 -> 000. - _Philippe Deléham_, Jan 08 2004 %t A006996 Table[ Mod[ Binomial[2n, n], 3], {n, 0, 104}] (* Or *) %t A006996 Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 0, 0}, 1 -> {1, 2, 0}, 2 -> {2, 1, 0}})]}], {1}, 7] (* _Robert G. Wilson v_, Mar 28 2005 *) %o A006996 (Haskell) %o A006996 a006996 n = a083093 (2 * n) n -- _Reinhard Zumkeller_, Jul 11 2013 %o A006996 (PARI) a(n)=if(n==0, return(1)); if(vecmax(Set(digits(n,3)))>1, 0, 1 + n%2) \\ _Charles R Greathouse IV_, May 09 2016 %o A006996 (Python) %o A006996 from gmpy2 import digits %o A006996 def A006996(n): return 0 if '2' in digits(n,3) else 1+(n&1) # _Chai Wah Wu_, Jun 26 2025 %Y A006996 Cf. A001285. %Y A006996 Cf. A074938, A074939, A074940. %Y A006996 Cf. A083093. %Y A006996 Cf. A000984, A005704. %K A006996 nonn,easy %O A006996 0,2 %A A006996 _N. J. A. Sloane_, _James Propp_