A039969 An example of a d-perfect sequence: a(n) = Catalan(n) mod 3.
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
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..10000
- Rob Burns, Asymptotic density of Catalan numbers modulo 3 and powers of 2, arXiv:1611.03705 [math.NT], 2016.
- David Kohel, San Ling and Chaoping Xing, Explicit Sequence Expansions, in: C. Ding, T. Helleseth and H. Niederreiter (eds.), Sequences and their Applications, Proceedings of SETA'98 (Singapore, 1998), Discrete Mathematics and Theoretical Computer Science, 1999, pp. 308-317; alternative link.
- Index entries for sequences that are fixed points of mappings
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
Comments