0

For a final, we were asked to write a program that would find positive integer solutions of the equation x^4 + y^4 + z^4 = kxyz where k is a constant. Solutions were (helpfully) limited to the integers between 1 and 1000. Even so, the brute force solution runs quite slowly, so we were asked to find a way to speed it up. My solution was to apply the constraint 1 =< x =< y =< z =< 1000, which worked well enough, but I did notice that when k is even, either all the variables must be even, or two must be odd. I couldn't think of a way to implement this that wouldn't just be wasteful.

Anyone have any ideas on how to make this work? Or is there a better way?

bendl
  • 1,583
  • 1
  • 18
  • 41
  • Nice little puzzle - not sure if it's relevant for SO - however, is k an integer too? Or real? It's obviously positive, since the powers on the left are even – doctorlove Dec 15 '16 at 16:50
  • k is also an integer. As for what have I tried, I mentioned that in the post. I'm looking for alternate methods. – bendl Dec 15 '16 at 16:51

0 Answers0