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.

A039969 An example of a d-perfect sequence: a(n) = Catalan(n) mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is A006996 with all its terms repeated three times, except the initial term only twice. A006996 is a fixed point of the morphism 0 -> 000, 1 -> 120, 2 -> 210. [The original comment edited by Antti Karttunen, Aug 14 2017]
Equals Catalan(n) mod 3. (Cf. A000108.) - Paul D. Hanna, Jun 20 2003 [confirmed by Christian G. Bower, Jun 12 2005]
Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).

Crossrefs

Cf. A006996 (trisection).

Programs

  • Magma
    [Catalan(n) mod 3: n in [1..80]]; // Vincenzo Librandi, Jul 14 2015
    
  • Maple
    seq(binomial(2*n, n)/(n+1) mod 3, n = 0 .. 100); # Robert Israel, Sep 20 2015
  • Mathematica
    Take[ Flatten[ Nest[ Flatten[ # /. {1 -> {1, 2, 0}, 2 -> {2, 1, 0}, 0 -> {0, 0, 0}}] &, {1}, 4] /. {1 -> {1, 1, 1}, 2 -> {2, 2, 2}, 0 -> {0, 0, 0}}], {2, 106}] (* or *)
    Table[ Mod[ Binomial[ 2n, n]/(n + 1), 3], {n, 0, 104}] (* Robert G. Wilson v, Sep 09 2005 *)
    Mod[CatalanNumber[Range[0,110]],3] (* Harvey P. Dale, Oct 23 2017 *)
  • PARI
    A039969(n) = ((binomial(2*n, n)/(n+1))%3); \\ Antti Karttunen, Aug 13 2017

Formula

a(n) = ((-1)^(n+1)*A001006(n-1)) mod 3, for n>0. - Christian G. Bower, Jun 12 2005
a(n) = a(n-1) if n == 0 or 1 (mod 3). a(n) = 0 if n == 5,6, or 7 (mod 9). - Robert Israel, Sep 20 2015
a(3n) = A006996(n). - Antti Karttunen, Aug 14 2017
Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = 0 (Burns, 2016). - Amiram Eldar, Jan 26 2021

Extensions

More terms from Christian G. Bower, Jun 12 2005
Offset corrected from 1 to 0 by Antti Karttunen, Aug 13 2017