Odd Number Theorem

Author

Eric W. Weisstein
April 14, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Algebra/OddNumberTheorem.nb.

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

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

Sum of First n odd numbers is square

Simplify[Sum[(2k-1),{k,n}]]

Table[2k-1,{k,5}]

Plus@@%

Gnomon[n_,x_:{0,0}]:=Module[{},
Line[x+#&/@{{0,0},{n,0},{n,1},{1,1},{1,n},{0,n},{0,0}}]
]

Show[GraphicsArray[{
Graphics[Table[
{Gnomon[n,(4-n){1,1}],
Text[2n-1,(4.5-n){1,1}]
},
{n,4}],AspectRatio->Automatic],
Graphics[
Table[{Line[{{0,x},{4,x}}],
Line[{{x,0},{x,4}}]},{x,0,4}],
AspectRatio->Automatic
]
}]]

Difference of two consecutive squares

Expand[n^2-(n-1)^2]

Table[HoldForm[nn^2-nm^2]==2n-1/.{nn->n,nm->n-1},{n,5}]//ColumnForm

ReleaseHold[%]