Problem 44793. Project Euler 249: Prime Subset Sums
Inspired by Problem 249 of Project Euler. https://projecteuler.net/problem=249
Let S = {2, 3, 5, ...} be the set of prime numbers less than N.
Find the number of subsets of S, the sum of whose elements is a prime number. Enter the rightmost 16 digits as your answer. The answer must be a uint64 integer.
Solution Stats
Problem Comments
-
2 Comments
The tip for this one is that It is possible to solve it within MATLAB's precision by using mod(x,10^16). No need for Java or Python (arbitrary-precision arithmetic).
At least those four lookup solutions inspired me to squeeze a bit harder to get down to 61.
Solution Comments
Show commentsProblem Recent Solvers22
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52646 Solvers
-
3993 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3059 Solvers
-
How to find the position of an element in a vector without using the find function
2810 Solvers
-
Matrix indexing with two vectors of indices
771 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!