OFFSET
1,5
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
D. Kohel, S. Ling and C. Xing, Explicit Sequence Expansions, in Sequences and their Applications, C. Ding, T. Helleseth, and H. Niederreiter, eds., Proceedings of SETA'98 (Singapore, 1998), 308-317, 1999. DOI: 10.1007/978-1-4471-0551-0_23
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
MATHEMATICA
Table[If[IntegerQ[n/2], 0, Mod[CatalanNumber[(n-1)/2], 3]], {n, 1, 100}] (* G. C. Greubel, Feb 13 2019 *)
PROG
(PARI)
A039969(n) = ((binomial(2*n, n)/(n+1))%3);
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Christian G. Bower, Jun 12 2005
Formula added to the name by Antti Karttunen, Feb 13 2019
STATUS
approved