Project Euler 87 - Prime Power Triples
Project Euler 87 - Prime Power Triples
Official link: https://projecteuler.net/problem=87
Thought Process
Thought Process
We can generate all the possible numbers by noticing that
floor(50,000,000^(1/2)) = 7071
floor(50,000,000^(1/3)) = 368
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
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