Legendre's three-square theorem states that a natural number can be represented as the sum of three squares of integers n=x2+y2+z2 if and only if n is not of the form n=4a(8b+7) for nonnegative integers a and b.
The first numbers that cannot be expressed as the sum of three squares (i.e. numbers that can be expressed as n=4a(8b+7)) are
n=40(8(0)+7)=7
n=40(8(1)+7)=15>7
n=40(8(2)+7)=23
n=41(8(0)+7)=28
n=40(8(2)+7)=23
n=40(8(3)+7)=31
n=40(8(4)+7)=39
n=40(8(5)+7)=47
n=40(8(6)+7)=55
n=41(8(0)+7)=60
...
Comments