A259667 Catalan numbers mod 6.
1, 1, 2, 5, 2, 0, 0, 3, 2, 2, 2, 4, 4, 4, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4, 4, 1, 0, 0, 0, 4, 4, 4, 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, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 4, 4, 4, 0, 0, 0, 4, 4, 4, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 2, 2, 2, 0, 0, 0, 2, 2, 2, 4
Offset: 0
Keywords
Links
- M. Alekseyev, PARI/GP Scripts for Miscellaneous Math Problems, sect. III: Binomial coefficients modulo integers, binomod.gp (v.1.4, 11/2015).
- V. Reshetnikov, A000108(n) ≡ 1 (mod 6), SeqFan list, Nov. 8, 2015.
Programs
-
Mathematica
Mod[CatalanNumber[Range[0,120]],6] (* Harvey P. Dale, Oct 24 2020 *)
-
PARI
a(n)=binomial(2*n,n)/(n+1)%6
-
PARI
A259667(n)=lift(if(n%3!=1,binomod(2*n+1,n,6)/(2*n+1), if(bittest(n,0),binomod(2*n,n-1,6)/n,binomod(2*n,n,6)/(n+1)))) \\ using binomod.gp by M. Alekseyev, cf. Links.
Formula
a(n) = A000108(n) mod 6.
Comments