Arithmetic Techniques Part 3:
Techniques for calculating n2

Created by Sho Sengoku, 2002

The calculation n2 that usualy takes long can be quickly and easily done using following formulas:

(a+b)2 = a2 + b2 + 2ab
(a-b)2 = a2 + b2 - 2ab

n2
(a+b)2 or (a-b)2
a2+2ab+b2 or a2-2ab+b2
Results
11 2
(10 + 1) 2
100 + 20 + 1
121
12 2
(10 + 2) 2
100 + 40 + 4
144
13 2
(10 + 3) 2
100 + 60 + 9
169
14 2
(10 + 4) 2
100 + 80 + 16
196
15 2
(10 + 5) 2
100 + 100 + 25
225
16 2
(10 + 6)2
or   (24) 2
100 + 120 + 36
or   28
256
17 2
(10 + 7)
or (16 + 1) 2
100 + 140 + 49
or 256 + 32 + 1
289
18 2
(20 - 2) 2
400 - 80 + 4
324
19 2
(20 - 1) 2
400 - 40 + 1
361
20 2
 
 
400
21 2
(20 + 1) 2
400 + 40 + 1
441
22 2
(20 + 2) 2
400 + 80 + 4
484
23 2
(20 + 3) 2
400 + 120 + 9
529
24 2
(20 + 4) 2
400 + 160 + 16
576
25 2
(20 + 5) 2
400 + 200 + 25
625
26 2
(20 + 6) 2
400 + 240 + 36
676
27 2
(30 - 3) 2
900 - 180 + 9
729
28 2
(30 - 2) 2
900 - 120 + 4
784
29 2
(30 - 1) 2
900 - 60 + 1
841
30 2
 
 
900
31 2
(30 + 1) 2
900 + 60 + 1
961
32 2
(30 + 2)2
or   (25) 2
900 + 120 + 4
or   210
1024
33 2
(30 + 3) 2
900 + 180 + 9
1089
34 2
(30 + 4) 2
900 + 240 + 16
1156
35 2
(30 + 5) 2
900 + 300 + 25
1225
36 2
(30 + 6) 2
900 + 360 + 36
1296
37 2
(40 - 3) 2
1600 - 240 + 9
1369
38 2
(40 - 2) 2
1600 - 160 + 4
1444
39 2
(40 - 1) 2
1600 - 80 + 1
1521
40 2
 
 
1600
41 2
(40 + 1) 2
1600 + 80 + 1
1681
42 2
(40 + 2) 2
1600 + 160 + 4
1764

In most case, you can omit the squre calculation in a Kleinman count by memorising the numbers colored in blue in the table (from 112 to 172).

Thanks to Michihito Kageyama who suggested this method to me as a part of the "real time" Kleinman count techniques.