Integer Triangle

Author

Eric W. Weisstein
September 20, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/DiophantineEquations/IntegerTriangle.nb.

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

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

Counts

Brute Force

s=Select[Union[Sort/@Tuples[Range[20],{3}]],TriangleQ];

t=Tally[Total/@s];

co=Complement[Range[20],First/@t]

Take[Last/@Union[{#,0}&/@co,t],20]

Round(((n^2)/12))-⌊(n/4)⌋ ⌊((n+2)/4)⌋

Table[Round[n^2/12]-Floor[n/4]Floor[(n+2)/4],{n,20}]

Round(If[n mod 2==0,((n^2)/48),(1/48) (((n+3))^2)])

FullSimplify[Round[n^2/12]-Floor[n/4]Floor[(n+2)/4],Mod[n,2]==0]

Table[Round[If[Mod[n,2]==0,((n^2)/48),((((n+3))^2)/48)]],{n,10}]

P(n,3)-(∑_j^(⌊n/2⌋))P(j,2)

partitionsP[n_,k_]:=Length[IntegerPartitions[n,{k}]]

Table[partitionsP[n,3]-Sum[partitionsP[j,2],{j,Floor[n/2]}],{n,10}]

Generating Function x^3/((1 - x^2)(1 - x^3)(1 - x^4))

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

f=(1/288) (-1+18 n+6 (n^2)-9 (((-1))^n) (3+2 n)-36 Cos[((n π)/2)]+64 Cos[((2 n π)/3)]-36 Sin[((n π)/2)]);

Sum[f (x^n),{n,0,∞}]

FullSimplify[%-x^3/((1-x^2)*(1-x^3)*(1-x^4))]

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

GeneratingFunction[f,n,x]

Factor[%]

Table[f,{n,10}]

FullSimplify[f,Mod[n,2]==0&&n>0]

FullSimplify[f,Mod[n,2]==1&&n>0]

(1/288) (6 (n^2)+18 n-9 (((-1))^n) (2 n+3)-36 sin(((π n)/2))-36 cos(((π n)/2))+64 cos(((2 π n)/3))-1)

f[n_]:=(1/288) (-1+18 n+6 (n^2)-9 (((-1))^n) (3+2 n)-36 Cos[((n π)/2)]+64 Cos[((2 n π)/3)]-36 Sin[((n π)/2)]);

FullSimplify[TrigToExp[(1/288) (-1+18 n+6 (n^2)-9 (((-1))^n) (3+2 n)-36 Cos[((n π)/2)]+64 Cos[((2 n π)/3)]-36 Sin[((n π)/2)])],n∈Integers&&n>0]

Identities

T(2 n)==T(2 n-3)

FullSimplify[f[2n]-f[2n-3],n∈Integers]

T(2 n) ==P(n,3)

FullSimplify[If[n≥3,(1/9) ((E^(-(2/3) I (-3+n) π))+(E^((2/3) I (-3+n) π)))+(1/72) (-7-9 (((-1))^n)+6 (n^2)),0]-f[2n],n∈Integers&&n>0]

InputForm[%]

FullSimplify[Piecewise[{{(7+9*(-1)^n-6*n^2-16*Cos[(4*n*Pi)/3])/72,n<3}},0],n∈Integers&&n>0]

Table[(1/72) (7+9 (((-1))^n)-6 (n^2)-16 Cos[((4 n π)/3)]),{n,0,2}]