Triangle Counting

Author

Eric W. Weisstein
January 2, 2009

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

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

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

Generating Function

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

SeriesCoefficient[((x^4)/((((1-x))^3)(1-(x^2)))),{x,0,n}]

s=FullSimplify[%,n≥0&&n∈Integers]

FullSimplify[s,Mod[n,2]==0]

FullSimplify[s,Mod[n,2]==1]

GeneratingFunction[(1/48) (-3+3 (((-1))^n)+20 n-18 (n^2)+4 (n^3)),n,x]

Factor[%]

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

Sum[(1/48) (3 (-1+(((-1))^n))+2 (-2+n) n (-5+2 n))(x^n),{n,0,∞}]

Sum[(x^n)Piecewise[{{(1/24) (-2+n) n (-5+2 n),Mod[n,2]==0},{(1/24) (-3+n) (-1+n) (-1+2 n),Mod[n,2]==1}}],{n,0,∞}]

FindSequenceFunction[Table[(1/48) (3 (-1+(((-1))^n))+2 (-2+n) n (-5+2 n)),{n,20}]]

FullSimplify[%]

FunctionExpand[%]