Metamath Proof Explorer


Theorem oddnumth

Description: The Odd Number Theorem. The sum of the first N odd numbers is N ^ 2 . A corollary of arisum . (Contributed by SN, 21-Mar-2025)

Ref Expression
Assertion oddnumth N 0 k = 1 N 2 k 1 = N 2

Proof

Step Hyp Ref Expression
1 fzfid N 0 1 N Fin
2 2cnd k 1 N 2
3 elfznn k 1 N k
4 3 nncnd k 1 N k
5 2 4 mulcld k 1 N 2 k
6 5 adantl N 0 k 1 N 2 k
7 1cnd N 0 k 1 N 1
8 1 6 7 fsumsub N 0 k = 1 N 2 k 1 = k = 1 N 2 k k = 1 N 1
9 arisum N 0 k = 1 N k = N 2 + N 2
10 9 oveq2d N 0 2 k = 1 N k = 2 N 2 + N 2
11 2cnd N 0 2
12 4 adantl N 0 k 1 N k
13 1 11 12 fsummulc2 N 0 2 k = 1 N k = k = 1 N 2 k
14 nn0cn N 0 N
15 14 sqcld N 0 N 2
16 15 14 addcld N 0 N 2 + N
17 2ne0 2 0
18 17 a1i N 0 2 0
19 16 11 18 divcan2d N 0 2 N 2 + N 2 = N 2 + N
20 10 13 19 3eqtr3d N 0 k = 1 N 2 k = N 2 + N
21 id N 0 N 0
22 1cnd N 0 1
23 21 22 fz1sumconst N 0 k = 1 N 1 = N 1
24 14 mulridd N 0 N 1 = N
25 23 24 eqtrd N 0 k = 1 N 1 = N
26 20 25 oveq12d N 0 k = 1 N 2 k k = 1 N 1 = N 2 + N - N
27 15 14 pncand N 0 N 2 + N - N = N 2
28 8 26 27 3eqtrd N 0 k = 1 N 2 k 1 = N 2