Central Trinomial Coefficient

Author

Eric W. Weisstein
July 30, 2006

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

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

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

Enumeration

CentralTrinomial[Range[10]]

Trinomial[#,0]&/@Range[10]

Congruences

Primes

Mod[CentralTrinomial[#],#]&/@Prime[Range[1000]]//Union

Divisibility

MapIndexed[Mod[#1,#2[[1]]]&,
-Subtract@@@Partition[CentralTrinomial[Range[20]],2,1]
]

Series

Series[(1/(Sqrt[(1+x)(1-3x)])),{x,0,5}]

v5.2

<<DiscreteMath`RSolve`

SeriesTerm[(1/(Sqrt[(1+x)(1-3x)])),{x,0,n}]

FullSimplify[%,n>0&&n∈Integers]

...wrong...

v6

<<DiscreteMath`RSolve`

SeriesTerm[(1/(Sqrt[(1+x)(1-3x)])),{x,0,n}]

FullSimplify[%,n>0&&n∈Integers]

Table[(((Sqrt[π]) Hypergeometric2F1Regularized[(1/2),-n,(1/2)-n,-3])/(n!)),{n,0,5}]

Closed Forms

(Subscript[, 2])(Subscript[F, 1])((1/2)-(n/2),-(n/2);1;4)

Table[Hypergeometric2F1[(1/2)-(n/2),-(n/2),1,4],{n,0,10}]

FullSimplify[Hypergeometric2F1[(1/2)-(n/2),-(n/2),1,4],n>0&&n∈Integers]

(i^n) (3^(n/2)) (Subscript[P, n])(-(i/(Sqrt[3])))

Table[I^n*3^(n/2)*LegendreP[n,-I/Sqrt[3]],{n,0,10}]

FullSimplify[I^n*3^(n/2)*LegendreP[n,-I/Sqrt[3]],n>0&&n∈Integers]

(((-1))^n) (Subscript[C, n]^((-n)))((1/2))

Table[(((-1))^n)GegenbauerC[n,-n,(1/2)],{n,0,10}]

FullSimplify[(((-1))^n)GegenbauerC[n,-n,(1/2)],n>0&&n∈Integers]

(((Sqrt[π]) (Subscript[, 2])(Subscript[(OverTilde[F]), 1])((1/2),-n;(1/2)-n;-3))/(n!))

Table[(((Sqrt[π]) Hypergeometric2F1Regularized[(1/2),-n,(1/2)-n,-3])/(n!)),{n,0,10}]

FullSimplify[(((Sqrt[π]) Hypergeometric2F1Regularized[(1/2),-n,(1/2)-n,-3])/(n!)),n>0&&n∈Integers]

FunctionExpand[(((Sqrt[π]) Hypergeometric2F1Regularized[(1/2),-n,(1/2)-n,-3])/(n!)),n>0&&n∈Integers]

(((((-4))^n) (Sqrt[π]) (Subscript[, 2])(Subscript[(OverTilde[F]), 1])(-n,-n;(1/2)-n;(1/4)))/(n!))

Table[(((((-4))^n)(Sqrt[π]) Hypergeometric2F1Regularized[-n,-n,(1/2)-n,(1/4)])/(n!)),{n,0,10}]

FullSimplify[(((((-4))^n)(Sqrt[π]) Hypergeometric2F1Regularized[-n,-n,(1/2)-n,(1/4)])/(n!)),n>0&&n∈Integers]

Plots

<<Utilities`Plot`

MakeBoxes[label,TraditionalForm]:=SubscriptBox[RowBox[{"(",GridBox[{{MakeBoxes[n,TraditionalForm]},{"0"}}],")"}],"2"]

ComplexPlot3D[CentralTrinomial[z],{z,-1,1},ComplexPlotLabel->label]//Timing

ComplexContourPlot[CentralTrinomial[z],{z,-1,1},ComplexPlotLabel->label]//Timing

Sums

(∑_(j=0)^n)((n!)/((((j!))^2) (n-2 j)!))

FullSimplify[Sum[((n!)/(((j!)^2)(n-2j)!)),{j,0,n}],n∈Integers]

(∑_(j=0)^n)(((-1))^j) (({{n}, {j}})) (({{2 n-2 j}, {n-j}}))

FullSimplify[Sum[(((-1))^j)Binomial[n,j]Binomial[2n-2j,n-j],{j,0,n}],n∈Integers&&n>0]

Table[(((((-4))^n) (Sqrt[π]) Hypergeometric2F1Regularized[-n,-n,(1/2)-n,(1/4)])/(n!)),{n,10}]

(∑_(k=0)^n)(({{n}, {2 k}})) (({{2 k}, {k}}))

Table[Sum[Binomial[n,2k]Binomial[2k,k],{k,0,n}],{n,0,10}]

FullSimplify[Sum[Binomial[n,2k]Binomial[2k,k],{k,0,n}],n∈Integers&&n>=0]

TraditionalForm[(((-1))^n)GegenbauerC[n,-n,(1/2)]]

Table[(-1)^n GegenbauerC[n,-n,(1/2)],{n,0,10}]

v6

FullSimplify[Sum[Binomial[n,2k]Binomial[2k,k],{k,0,n}],n∈Integers&&n>=0]

Table[Hypergeometric2F1[(1/2)-(n/2),-(n/2),1,4],{n,0,10}]

Timings

With[{n=10^4},(-1)^n GegenbauerC[n,-n,1/2]];//Timing

With[{n=10^4},I^n*3^(n/2)*LegendreP[n,-I/Sqrt[3]]];//Timing

Primes

Position[CentralTrinomial[Range[1000]],_?PrimeQ]//Flatten//Timing

Digits[CentralTrinomial[4]]

Divisors

(Plus@@Last/@#)&/@FactorInteger/@CentralTrinomial[Range[20]]

FactorInteger/@CentralTrinomial[Range[20]]//ColumnForm

Recurrence

RSolve[{a[n]==((2*n-1)*a[n-1]+3*(n-1)*a[n-2])/n,a[0]==1,a[1]==1},a[n],n]

a[0]=1;
a[1]=1;
a[n_]:=a[n]=((2*n-1)*a[n-1]+3*(n-1)*a[n-2])/n

a/@Range[10]

Timings

With[{n=10^5},Hypergeometric2F1[(1/2)-(n/2),-(n/2),1,4]];//Timing

With[{n=10^5},I^n*3^(n/2)*LegendreP[n,-I/Sqrt[3]]];//Timing

With[{n=10^5},(((((-4))^n)(Sqrt[π]) Hypergeometric2F1Regularized[-n,-n,(1/2)-n,(1/4)])/(n!))];//Timing

With[{n=10^5},(((Sqrt[π]) Hypergeometric2F1Regularized[(1/2),-n,(1/2)-n,-3])/(n!))];//Timing

DifferenceRoot[Function[{\[FormalY],\[FormalN]},{(-3-3 \[FormalN]) \[FormalY][\[FormalN]]+(-3-2 \[FormalN]) \[FormalY][1+\[FormalN]]+(2+\[FormalN]) \[FormalY][2+\[FormalN]]==0,\[FormalY][0]==1,\[FormalY][1]==1}]][10^5];//Timing

CentralTrinomial[10^5];//Timing

Sequence with Minus Signs

Table[Coefficient[(x^2-x-1)^n,x,n],{n,10}]

Sum[Binomial[n,k]Binomial[n-k,k](-1)^k,{k,0,n/2}]

Table[(I^n) GegenbauerC[n,-n,-(I/2)],{n,10}]

Position[Table[(I^n) GegenbauerC[n,-n,-(I/2)],{n,1000}],_?PrimeQ]//Flatten//Timing

PrimeQ[Function[n,(I^n) GegenbauerC[n,-n,-(I/2)]]/@{3,4,5,6,7,10,11,12,26,160,3787,31877}]//Timing

Digits[Abs[Function[n,(I^n) GegenbauerC[n,-n,-(I/2)]][31877]]]