

One form of   Pythagorean quadruples   is   (for positive integers   a,   b,   c,   and   d):



    a2   +   b2   +   c2     =     d2 


An example:

    22   +   32   +   62     =     72 
 which is:
    4    +   9    +   36     =     49 


Task

For positive integers up   2,200   (inclusive),   for all values of   a,  
b,   c,   and   d,

find   (and show here)   those values of   d   that   can't   be represented.

Show the values of   d   on one line of output   (optionally with a title).



Related tasks

   Euler's sum of powers conjecture. 
   Pythagorean triples.


Reference

   the Wikipedia article:   Pythagorean quadruple.


with javascript_semantics
constant N = 2200,
         N2 = N*N*2
sequence found = repeat(false,N),
         squares = repeat(false,N2)
-- first mark all numbers that can be the sum of two squares
for a=1 to N do
    integer a2 = a*a
    for b=a to N do
        squares[a2+b*b] = true
    end for
end for
-- now find all d such that d^2 - c^2 is in squares
for d=1 to N do
    integer d2 = d*d
    for c=1 to d-1 do
        if squares[d2-c*c] then
            found[d] = true
            exit
        end if
    end for
end for
 
sequence res = {}
for i=1 to N do
    if not found[i] then res &= i end if
end for
pp(res)
