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.


import scala.collection.Searching.{Found, search}
 
object EulerSopConjecture extends App {
 
  val (maxNumber, fifth) = (250, (1 to 250).map { i => math.pow(i, 5).toLong })
 
  def binSearch(fact: Int*) = fifth.search(fact.map(f => fifth(f)).sum)
 
  def sop = (0 until maxNumber)
    .flatMap(a => (a until maxNumber)
      .flatMap(b => (b until maxNumber)
        .flatMap(c => (c until maxNumber)
          .map { case x$1@d => (binSearch(a, b, c, d), x$1) }
          .withFilter { case (f, _) => f.isInstanceOf[Found] }
          .map { case (f, d) => (a + 1, b + 1, c + 1, d + 1, f.insertionPoint + 1) }))).take(1)
    .map { case (a, b, c, d, f) => s"$a⁵ + $b⁵ + $c⁵ + $d⁵ = $f⁵" }
 
  println(sop)
 
}