

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.


 
#include <flow.h>
 
DEF-MAIN(argv, argc)
   SET(N, 2200)
   DIM( MUL(MUL(N,N),2) ) AS-ZEROS( temp )
   DIM( N ) AS-ZEROS( found )
 
   MSET( a,T1,T2 )
   TIC(T1)
   SEQ-SPC(1,N,N,a), LET( a := MUL(a,a) )
 
   SET(i,1), SET(r,0)
   PERF-UP(i,N,1)
       LET( r := ADD( [i] GET( a ), [i:end] CGET(a) ) )
       SET-RANGE( r ), SET(temp, 1), CLR-RANGE
   NEXT
 
   SET(c,1), SET(s,3), MSET(s1,s2,d)
   PERF-UP(c, N, 1)
       LET( s1 := s )
       s += 2
       LET( s2 := s )
       LET( d := ADD(c,1) )
       PERF-UP(d, N, 1)
           COND ( [s1] GET(temp) ) 
              [d] {1} PUT(found)
           CEND
           s1 += s2
           s2 += 2
       NEXT
   NEXT
   TOC(T1, T2), PRNL("Time = ", T2 )
   PRN( "Imprimiendo resultados:\n" )
   CART( IS-ZERO?( found ) ) MOVE-TO( r )
   PRNL( r )
 
   MCLEAR(temp, found, a, r)
END
 