Super Catalan Number

Author

Eric W. Weisstein
October 4, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/SuperCatalanNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SuperCatalanNumber.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Code

S[1]:=1
S[2]:=1
S[n_]:=S[n]=((3(2n-3)S[n-1]-(n-3)S[n-2])/n)

S[n_]:=(3LegendreP[n-1,3]-LegendreP[n-2,3])/(4n)

Enumeration

S/@Range[10]

FunctionExpand[(3LegendreP[n-1,3]-LegendreP[n-2,3])/(4n)]

Generating Function

x+2Sum[((-LegendreP[-2+n,3]+3 LegendreP[-1+n,3])/(4 n))(x^n),{n,∞}]

GeneratingFunction[((-LegendreP[-2+n,3]+3 LegendreP[-1+n,3])/(4 n)),n,x]

x+2Sum[((-LegendreP[-2+n,3]+3 LegendreP[-1+n,3])/(4 n))(x^n),{n,10}]//Expand

Series[((1+x-(Sqrt[1-6x+(x^2)]))/2),{x,0,10}]//Normal

Recurrence

V4.2

<<DiscreteMath`RSolve`

RSolve[{n S[n]==3(2n-3)S[n-1]-(n-3)S[n-2],S[1]==S[2]==1},S[n],n]

FullSimplify[%,n>2]

Table[(3LegendreP[n-1,3]-LegendreP[n-2,3])/(4n),{n,10}]

Table[(1/4)(-LegendreP[-2+n,3]+6 LegendreP[-1+n,3]-LegendreP[n,3]),{n,10}]

V5

RSolve[{n S[n]==3(2n-3)S[n-1]-(n-3)S[n-2],S[1]==S[2]==1},S[n],n]

V5.1

RSolve[{n S[n]==3(2n-3)S[n-1]-(n-3)S[n-2],S[1]==S[2]==1},S[n],n]

V7

RSolve[{n S[n]==3(2n-3)S[n-1]-(n-3)S[n-2],S[1]==S[2]==1},S[n],n]

Table[(-5*GegenbauerC[n,-1/2,3]+GegenbauerC[n,-1/2,3]*Sum[Product[(3*GegenbauerC[1+K[1],-1/2,3]-2*GegenbauerC[2+K[1],-1/2,3]+6*GegenbauerC[1+K[1],-1/2,3]*K[1]-GegenbauerC[2+K[1],-1/2,3]*K[1])/(GegenbauerC[2+K[1],-1/2,3]*(2+K[1])),{K[1],2,-1+K[2]}],{K[2],0,-1+n}])/12,{n,5}]

Prime

(p=Position[S/@Range[10^3],_?PrimeQ]//Flatten)//Timing

(p=Position[S/@Range[10^4],_?PrimeQ]//Flatten)//Timing

(p=Position[S/@Range[2 10^4],_?PrimeQ]//Flatten)//Timing

Digits[S[216]]//Timing

S/@p