Metamath Proof Explorer


Theorem sqoddm1div8

Description: A squared odd number minus 1 divided by 8 is the odd number multiplied with its successor divided by 2. (Contributed by AV, 19-Jul-2021)

Ref Expression
Assertion sqoddm1div8 N M = 2 N + 1 M 2 1 8 = N N + 1 2

Proof

Step Hyp Ref Expression
1 oveq1 M = 2 N + 1 M 2 = 2 N + 1 2
2 2z 2
3 2 a1i N 2
4 id N N
5 3 4 zmulcld N 2 N
6 5 zcnd N 2 N
7 binom21 2 N 2 N + 1 2 = 2 N 2 + 2 2 N + 1
8 6 7 syl N 2 N + 1 2 = 2 N 2 + 2 2 N + 1
9 1 8 sylan9eqr N M = 2 N + 1 M 2 = 2 N 2 + 2 2 N + 1
10 9 oveq1d N M = 2 N + 1 M 2 1 = 2 N 2 + 2 2 N + 1 - 1
11 2cnd N 2
12 zcn N N
13 11 12 sqmuld N 2 N 2 = 2 2 N 2
14 sq2 2 2 = 4
15 14 a1i N 2 2 = 4
16 15 oveq1d N 2 2 N 2 = 4 N 2
17 13 16 eqtrd N 2 N 2 = 4 N 2
18 mulass 2 2 N 2 2 N = 2 2 N
19 18 eqcomd 2 2 N 2 2 N = 2 2 N
20 11 11 12 19 syl3anc N 2 2 N = 2 2 N
21 2t2e4 2 2 = 4
22 21 a1i N 2 2 = 4
23 22 oveq1d N 2 2 N = 4 N
24 20 23 eqtrd N 2 2 N = 4 N
25 17 24 oveq12d N 2 N 2 + 2 2 N = 4 N 2 + 4 N
26 25 oveq1d N 2 N 2 + 2 2 N + 1 = 4 N 2 + 4 N + 1
27 26 oveq1d N 2 N 2 + 2 2 N + 1 - 1 = 4 N 2 + 4 N + 1 - 1
28 4z 4
29 28 a1i N 4
30 zsqcl N N 2
31 29 30 zmulcld N 4 N 2
32 31 zcnd N 4 N 2
33 29 4 zmulcld N 4 N
34 33 zcnd N 4 N
35 32 34 addcld N 4 N 2 + 4 N
36 pncan1 4 N 2 + 4 N 4 N 2 + 4 N + 1 - 1 = 4 N 2 + 4 N
37 35 36 syl N 4 N 2 + 4 N + 1 - 1 = 4 N 2 + 4 N
38 27 37 eqtrd N 2 N 2 + 2 2 N + 1 - 1 = 4 N 2 + 4 N
39 38 adantr N M = 2 N + 1 2 N 2 + 2 2 N + 1 - 1 = 4 N 2 + 4 N
40 10 39 eqtrd N M = 2 N + 1 M 2 1 = 4 N 2 + 4 N
41 40 oveq1d N M = 2 N + 1 M 2 1 8 = 4 N 2 + 4 N 8
42 4cn 4
43 42 a1i N 4
44 30 zcnd N N 2
45 43 44 12 adddid N 4 N 2 + N = 4 N 2 + 4 N
46 45 eqcomd N 4 N 2 + 4 N = 4 N 2 + N
47 46 oveq1d N 4 N 2 + 4 N 8 = 4 N 2 + N 8
48 47 adantr N M = 2 N + 1 4 N 2 + 4 N 8 = 4 N 2 + N 8
49 4t2e8 4 2 = 8
50 49 a1i N 4 2 = 8
51 50 eqcomd N 8 = 4 2
52 51 oveq2d N 4 N 2 + N 8 = 4 N 2 + N 4 2
53 30 4 zaddcld N N 2 + N
54 53 zcnd N N 2 + N
55 2cnne0 2 2 0
56 55 a1i N 2 2 0
57 4ne0 4 0
58 42 57 pm3.2i 4 4 0
59 58 a1i N 4 4 0
60 divcan5 N 2 + N 2 2 0 4 4 0 4 N 2 + N 4 2 = N 2 + N 2
61 54 56 59 60 syl3anc N 4 N 2 + N 4 2 = N 2 + N 2
62 12 sqvald N N 2 = N N
63 62 oveq1d N N 2 + N = N N + N
64 12 mulid1d N N 1 = N
65 64 eqcomd N N = N 1
66 65 oveq2d N N N + N = N N + N 1
67 1cnd N 1
68 adddi N N 1 N N + 1 = N N + N 1
69 68 eqcomd N N 1 N N + N 1 = N N + 1
70 12 12 67 69 syl3anc N N N + N 1 = N N + 1
71 63 66 70 3eqtrd N N 2 + N = N N + 1
72 71 oveq1d N N 2 + N 2 = N N + 1 2
73 52 61 72 3eqtrd N 4 N 2 + N 8 = N N + 1 2
74 73 adantr N M = 2 N + 1 4 N 2 + N 8 = N N + 1 2
75 41 48 74 3eqtrd N M = 2 N + 1 M 2 1 8 = N N + 1 2