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
012
0 728112
1 1560240
2 2392368
3 31124496
4 39156624
5 47188752
6 55220880
7 632521008
8 712841136
9 793161264
10 873481392
11 953801520
12 1034121648
Unexpressible values
up to 100 are in bold