login
A039970
An example of a d-perfect sequence: a(2*n) = 0, a(2*n+1) = Catalan(n) mod 3.
1
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,5
LINKS
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);
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
(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
Cf. A039969.
Sequence in context: A038555 A138108 A158777 * A373917 A179212 A105118
KEYWORD
nonn
EXTENSIONS
More terms from Christian G. Bower, Jun 12 2005
Formula added to the name by Antti Karttunen, Feb 13 2019
STATUS
approved