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.


 
makepowers :-
    retractall(pow5(_, _)),
    between(1, 249, X),
    Y is X * X * X * X * X,
    assert(pow5(X, Y)),
    fail.
makepowers.
 
within(A, Bx, N) :-  % like between but with an exclusive upper bound
   succ(B, Bx),
   between(A, B, N).
 
solution(X0, X1, X2, X3, Y) :-
    makepowers,
    within(4, 250, X0), pow5(X0, X0_5th),
    within(3, X0,  X1), pow5(X1, X1_5th),
    within(2, X1,  X2), pow5(X2, X2_5th),
    within(1, X2,  X3), pow5(X3, X3_5th),
    Y_5th is X0_5th + X1_5th + X2_5th + X3_5th,
    pow5(Y, Y_5th).
 