[go: up one dir, main page]

login
A107755
Numbers k such that Sum_{j=1..k} Catalan(j) == 0 (mod 3).
10
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,1
LINKS
Y. More, Problem 11165, Amer. Math. Monthly, 112 (2005), 568.
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
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 *)
PROG
(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
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 11 2005
EXTENSIONS
More terms from Emeric Deutsch, Jun 12 2005
Corrected & extended by M. F. Hasler and R. J. Mathar, Feb 25 2008
STATUS
approved