There is a conjecture in mathematics that held for over two hundred years before it was disproved by the finding of a counterexample in 1966 by Lander and Parkin.



Euler's (disproved) sum of powers   conjecture

  At least  k  positive  kth  powers are required to sum to a  kth  power,  
  except for the trivial case of one  kth power:  yk = yk 



In 1966,   Leon J. Lander   and   Thomas R. Parkin   used a brute-force search on a   CDC 6600   computer restricting numbers to those less than 250.



Task

Write a program to search for an integer solution for:


  x05 + x15 + x25 + x35 == y5 

Where all     xi's   and    y    are distinct integers between   0   and   250   (exclusive).

Show an answer here.



Related tasks

   Pythagorean quadruples. 
   Pythagorean triples.


MODULE EulerConjecture;
FROM FormatString IMPORT FormatString;
FROM Terminal IMPORT WriteString,WriteLn,ReadChar;
 
PROCEDURE Pow5(a : LONGINT) : LONGINT;
BEGIN
    RETURN a * a * a * a * a
END Pow5;
 
VAR
    buf : ARRAY[0..63] OF CHAR;
    a,b,c,d,e,sum,curr : LONGINT;
BEGIN
    FOR a:=0 TO 250 DO
        FOR b:=a TO 250 DO
            IF b=a THEN CONTINUE END;
            FOR c:=b TO 250 DO
                IF (c=a) OR (c=b) THEN CONTINUE END;
                FOR d:=c TO 250 DO
                    IF (d=a) OR (d=b) OR (d=c) THEN CONTINUE END;
                    sum := Pow5(a) + Pow5(b) + Pow5(c) + Pow5(d);
                    FOR e:=d TO 250 DO
                        IF (e=a) OR (e=b) OR (e=c) OR (e=d) THEN CONTINUE END;
                        curr := Pow5(e);
                        IF (sum#0) AND (sum=curr) THEN
                            FormatString("%l^5 + %l^5 + %l^5 + %l^5 = %l^5\n", buf, a, b, c, d, e);
                            WriteString(buf)
                        ELSIF curr > sum THEN
                            BREAK
                        END
                    END;
                END;
            END;
        END;
    END;
 
    WriteString("Done");
    WriteLn;
    ReadChar
END EulerConjecture.