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.

A039970 An example of a d-perfect sequence: a(2*n) = 0, a(2*n+1) = Catalan(n) mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A039969.

Programs

  • Magma
    [n mod 2 eq 0 select 0 else Catalan(Floor((n-1)/2)) mod 3: n in [1..100]]; // G. C. Greubel, Feb 13 2019
  • Mathematica
    Table[If[IntegerQ[n/2], 0, Mod[CatalanNumber[(n-1)/2], 3]], {n, 1, 100}] (* G. C. Greubel, Feb 13 2019 *)
  • PARI
    A039969(n) = ((binomial(2*n, n)/(n+1))%3);
    A039970(n) = if(n%2,A039969((n-1)/2),0); \\ Antti Karttunen, Feb 13 2019
    
  • Sage
    def A039970(n):
        if (mod(n,2)==0):
            return 0
        else:
            return mod(catalan_number((n-1)/2), 3)
    [A039970(n) for n in (1..100)] # G. C. Greubel, Feb 13 2019
    

Formula

a(2*n) = 0, a(2*n+1) = A039969(n). - Christian G. Bower, Jun 12 2005, sign edited because of changed offset of A039969. - Antti Karttunen, Feb 13 2019

Extensions

More terms from Christian G. Bower, Jun 12 2005
Formula added to the name by Antti Karttunen, Feb 13 2019