A107755 Numbers k such that Sum_{j=1..k} Catalan(j) == 0 (mod 3).
2, 8, 12, 26, 30, 36, 38, 80, 84, 90, 92, 108, 110, 116, 120, 242, 246, 252, 254, 270, 272, 278, 282, 324, 326, 332, 336, 350, 354, 360, 362, 728, 732, 738, 740, 756, 758, 764, 768, 810, 812, 818, 822, 836, 840, 846, 848, 972, 974, 980, 984, 998, 1002, 1008, 1010
Offset: 1
Links
- R. J. Mathar, Table of n, a(n) for n = 1..319.
- Y. More, Problem 11165, Amer. Math. Monthly, 112 (2005), 568.
Programs
-
Maple
A107755 := proc(n) option remember ; local a; if n = 1 then 2; else for a from A107755(n-1)+1 do if add(A000108(k),k=1..a) mod 3 = 0 then RETURN(a) ; fi ; od: fi ; end: # R. J. Mathar, Feb 25 2008 c:=n->binomial(2*n,n)/(n+1): s:=0: for n from 1 to 1500 do s:=s+c(n): a[n]:=s mod 3: od: A:=[seq(a[n],n=1..1500)]: p:=proc(n) if A[n]=0 then n else fi end: seq(p(n),n=1..1500); # Emeric Deutsch, Jun 12 2005
-
Mathematica
s0 = s2 = {}; s = 0; Do[s = Mod[s + (2 n)!/n!/(n + 1)!, 3]; Switch[ Mod[s, 3], 0, AppendTo[s0, n], 2, AppendTo[s2, n]], {n, 1055}]; s0 (* Robert G. Wilson v, Jun 14 2005 *) Flatten[Position[Accumulate[CatalanNumber[Range[1100]]],?(Divisible[ #,3]&)]] (* _Harvey P. Dale, Feb 07 2016 *)
-
PARI
n=0; s=Mod(0,3); A107755=vector(100,i, if( bitand(i,i-1), while(n++ && s+=binomial(2*n,n)/(n+1),), s=Mod(0,3);n=2*n+2+(log(i+.5)\log(2)%2)*2 ); /*print1(n",");*/ n) \\ M. F. Hasler, Feb 25 2008
-
PARI
A107755(n)=sum( i=1,n, A137822(i) )*2 /* allows computation of a(10^4) in one second */ \\ M. F. Hasler, Mar 16 2008
Formula
a(2^j) = 2*a(2^j-1) + 2 (resp. + 4) if j is even (resp. odd). - M. F. Hasler, Feb 25 2008
a(n) = 2*Sum_{i=1..n} A137822(i). - M. F. Hasler, Mar 16 2008
{n: A137993(n-1) = 0}. - R. J. Mathar, Jul 07 2009
Extensions
More terms from Emeric Deutsch, Jun 12 2005
Corrected & extended by M. F. Hasler and R. J. Mathar, Feb 25 2008