Square Triangular Number

Author

Eric W. Weisstein
January 27, 2010

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/SquareTriangularNumber.nb.

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

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

Analytic Form

Reduce[TriangularNumber[n]==SquareNumber[m]&&n>0&&m>0,Integers]

SquareNumber[-(((((3-2 (Sqrt[2])))^k)-(((3+2 (Sqrt[2])))^k))/(4 (Sqrt[2])))]

FullSimplify[TriangularNumber[(1/2) (-1+(1/2) ((((3-2 (Sqrt[2])))^k)+(((3+2 (Sqrt[2])))^k)))]]

(1/32) (-2+((Expand[(((3-2 (Sqrt[2])))^(2 ))])^k)+Expand[(((3+2 (Sqrt[2])))^2)]^k)

Table[(1/32) (-2+(((17-12 (Sqrt[2])))^k)+(((17+12 (Sqrt[2])))^k)),{k,0,10}]//Expand

(v1=(1/32) (-2+(((17-12 (Sqrt[2])))^k)+(((17+12 (Sqrt[2])))^k))/.k->10^4//Expand);//Timing

(v2=RecurrenceTable[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s,{n,{10^4}}][[1]]);//Timing

v1==v2

RecurrenceTable[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s,n]//TraditionalForm

Recurrence

s(n)==-s(n-2)+34 s(n-1)+2

V6

RSolve[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s[n],n]

V7

RSolve[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s[n],n]

RecurrenceTable[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s,{n,{10}}]

RecurrenceTable[{s[n]==34s[n-1]-s[n-2]+2,s[0]==0,s[1]==1},s,{n,10}]

u(n+2)==6 u(n+1)-u(n)

V6

RSolve[{u[n+2]==6u[n+1]-u[n],u[0]==0,u[1]==1},u[n],n]

V7

RSolve[{u[n+2]==6u[n+1]-u[n],u[0]==0,u[1]==1},u[n],n]

RecurrenceTable[{u[n+2]==6u[n+1]-u[n],u[0]==0,u[1]==1},u,{n,10}]^2

u(n+1)==(Sqrt[8 ((u(n))^2)+1])+3 u(n)

V6

RSolve[{u[n+1]==3u[n]+Sqrt[8u[n]^2+1],u[0]==0,u[1]==1},u[n],n]

V7

RSolve[{u[n+1]==3u[n]+Sqrt[8u[n]^2+1],u[0]==0,u[1]==1},u[n],n]

V8

RSolve[{u[n+1]==3u[n]+Sqrt[8u[n]^2+1],u[0]==0,u[1]==1},u[n],n]

Check

FullSimplify[u[n+1]-(3u[n]+Sqrt[8u[n]^2+1])/.u[n_]:>-(((((3-2 (Sqrt[2])))^n)-(((3+2 (Sqrt[2])))^n))/(4 (Sqrt[2]))),n>0&&n∈Integers]

Table[(1/2) ((((3-2 (Sqrt[2])))^n)+(((3+2 (Sqrt[2])))^n)-(Sqrt[2+(((3-2 (Sqrt[2])))^(2 n))+(((3+2 (Sqrt[2])))^(2 n))])),{n,10}]//ExpandAll

Generating Function

GeneratingFunction[(1/32) (((17+12 (Sqrt[2])))^(-n)) (((-1+(((17+12 (Sqrt[2])))^n)))^2),n,x]//FullSimplify//Factor

Sum[(1/32) (((17+12 (Sqrt[2])))^(-n)) (((-1+(((17+12 (Sqrt[2])))^n)))^2)(x^n),{n,0,∞}]

FullSimplify[%]//Factor

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

FullSimplify[SeriesCoefficient[((x(1+x))/((1-x)(1-34x+x^2))),{x,0,n}],n>=0&&n∈Integers]

Product

Table[(2^(2n-5))Product[3+Cos[((k Pi)/n)],{k,2n}],{n,6}]//Expand

Table[(1/32) (((17+12 (Sqrt[2])))^(-n)) (((-1+(((17+12 (Sqrt[2])))^n)))^2),{n,0,6}]//ExpandAll//FullSimplify

V6

(2^(2n-5))Product[3+Cos[((k Pi)/n)],{k,2n}]

V7

(2^(2n-5))Product[3+Cos[((k Pi)/n)],{k,2n}]

V8

(2^(2n-5))Product[3+Cos[((k Pi)/n)],{k,2n}]