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.


$ include "seed7_05.s7i";
 
const func integer: binarySearch (in array integer: arr, in integer: aKey) is func
  result
    var integer: index is 0;
  local
    var integer: low is 1;
    var integer: high is 0;
    var integer: middle is 0;
  begin
    high := length(arr);
    while index = 0 and low <= high do
      middle := (low + high) div 2;
      if aKey < arr[middle] then
        high := pred(middle);
      elsif aKey > arr[middle] then
        low := succ(middle);
      else
        index := middle;
      end if;
    end while;
  end func;
 
const proc: main is func
  local
    var array integer: p5 is 249 times 0;
    var integer: i is 0;
    var integer: x0 is 0;
    var integer: x1 is 0;
    var integer: x2 is 0;
    var integer: x3 is 0;
    var integer: sum is 0;
    var integer: y is 0;
    var boolean: found is FALSE;
  begin
    for i range 1 to 249 do
      p5[i] := i ** 5;
    end for;
    for x0 range 1 to 249 until found do
      for x1 range 1 to pred(x0) until found do
        for x2 range 1 to pred(x1) until found do
          for x3 range 1 to pred(x2) until found do
            sum := p5[x0] + p5[x1] + p5[x2] + p5[x3];
            y := binarySearch(p5, sum);
            if y > 0 then
              writeln(x0 <& "**5 + " <& x1 <& "**5 + " <& x2 <& "**5 + " <& x3 <& "**5 = " <& y <& "**5");
              found := TRUE;
            end if;
          end for;
        end for;
      end for;
    end for;
    if not found then
      writeln("No solution was found");
    end if;
  end func;