cp's OEIS Frontend

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.

A006996 a(n) = C(2n,n) mod 3.

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Keywords

Comments

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
a(n) = 0 if n in A074940, a(n) = 1 if n in A074939, a(n) = 2 if n in A074938.
Central terms of the triangle in A083093. - Reinhard Zumkeller, Jul 11 2013

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006996 n = a083093 (2 * n) n  -- Reinhard Zumkeller, Jul 11 2013
    
  • Mathematica
    Table[ Mod[ Binomial[2n, n], 3], {n, 0, 104}] (* Or *)
    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 *)
  • 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
    
  • Python
    from gmpy2 import digits
    def A006996(n): return 0 if '2' in digits(n,3) else 1+(n&1) # Chai Wah Wu, Jun 26 2025

Formula

a(n) = A000984(n) mod 3.
a(n) = A005704(n) mod 3. - Benoit Cloitre, Jan 04 2004
A fixed point of the morphism : 1 -> 120, 2 -> 210, 0 -> 000. - Philippe Deléham, Jan 08 2004