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.


' version 14-09-2015
' compile with: fbc -s console
 
' some constants calculated when the program is compiled
 
Const As UInteger max = 250
Const As ULongInt pow5_max = CULngInt(max) * max * max * max * max
' limit x1, x2, x3
Const As UInteger limit_x1 = (pow5_max / 4) ^ 0.2
Const As UInteger limit_x2 = (pow5_max / 3) ^ 0.2
Const As UInteger limit_x3 = (pow5_max / 2) ^ 0.2
 
' ------=< MAIN >=------
 
Dim As ULongInt pow5(max), ans1, ans2, ans3
Dim As UInteger x1, x2, x3, x4, x5 , m1, m2
 
Cls : Print
 
For x1 = 1 To max
    pow5(x1) = CULngInt(x1) * x1 * x1 * x1 * x1
Next x1
 
For x1 = 1 To limit_x1
    For x2 = x1 +1 To limit_x2
        m1 = x1 + x2
        ans1 = pow5(x1) + pow5(x2)
        If ans1 > pow5_max Then Exit For
        For x3 = x2 +1 To limit_x3
            ans2 = ans1 + pow5(x3)
            If ans2 > pow5_max Then Exit For
            m2 = (m1 + x3) Mod 30
            If m2 = 0 Then m2 = 30
            For x4 = x3 +1 To max -1
                ans3 = ans2 + pow5(x4)
                If ans3 > pow5_max Then Exit For
                For x5 = x4 + m2 To max Step 30
                    If ans3 < pow5(x5) Then Exit For
                    If ans3 = pow5(x5) Then
                        Print x1; "^5 + "; x2; "^5 + "; x3; "^5 + "; _
                              x4; "^5 = "; x5; "^5"
                        Exit For, For
                    EndIf
                Next x5
            Next x4
        Next x3
    Next x2
Next x1
 
Print
Print "done"
 
' empty keyboard buffer
While Inkey <> "" : Wend
Print : Print "hit any key to end program"
Sleep
End