I found this problem in Project Euler: https://projecteuler.net/problem=87
The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is $28$. In fact, there are exactly four numbers $<50$ that can be expressed in such a way:
$$28 = 2^2 + 2^3 + 2^4$$ $$33 = 3^2 + 2^3 + 2^4$$ $$49 = 5^2 + 2^3 + 2^4$$ $$47 = 2^2 + 3^3 + 2^4$$
How many numbers $<50\, 000\, 000$ can be expressed as the sum of a prime square, prime cube, and prime fourth power?
What's the optimized solution to solve this problem?