Legendre's three-square theorem

In mathematics, Legendre's three-square theorem states that a natural number can be represented as the sum of three squares of integers

if and only if n is not of the form for nonnegative integers a and b.

Distances between vertices of a double unit cube are square roots of the first six natural numbers due to the Pythagorean theorem (√7 is not possible due to Legendre's three-square theorem)

The first numbers that cannot be expressed as the sum of three squares (i.e. numbers that can be expressed as ) are

7, 15, 23, 28, 31, 39, 47, 55, 60, 63, 71 ... (sequence A004215 in the OEIS).
a
b
0 1 2
0 7 28 112
1 15 60 240
2 23 92 368
3 31 124 496
4 39 156 624
5 47 188 752
6 55 220 880
7 63 252 1008
8 71 284 1136
9 79 316 1264
10 87 348 1392
11 95 380 1520
12 103 412 1648
Unexpressible values
up to 100 are in bold