In this problem we want to find out how many numbers less than 50 million can be expressed in the form a2 + b3 + c4 where a, b and c are prime numbers.

The stupidest approach to this problem might be to take each of the numbers up to 50 million, do a prime factorisation and then check to see if the required condition is met. I must be getting better at this, because I didn't consider this a viable method.  

It turns out that the problem isn't overly difficult once we realise that the square root of 50 million is roughly 7071. This means that we only have to check values of a that are prime and less than 7071. The cube root of 50 million is about 368, so we have even fewer values to check for b. The forth root is about 84.

The only problem I had with this was generating the same number twice with different values of a, b and c. Putting the results into a set avoided this duplication.