Project Euler 87 - Prime Power Triples

Official link: https://projecteuler.net/problem=87

Thought Process

We can generate all the possible numbers by noticing that

  1. floor(50,000,000^(1/2)) = 7071

  2. floor(50,000,000^(1/3)) = 368

  3. floor(50,000,000^(1/4)) = 84

So we can make 3 lists with all the primes (Using my prime generator function) less than 7071, 368, and 84 respectively, do a triple nested loop add all the possibilities to a final_list, and then take the length of the set(final_list) to remove duplicates

Interactive Code

Enter an integer (yourinput)

Code will output the number of numbers below fifty million can be expressed as the sum of a prime square, prime cube, and prime fourth power