The sequence in question in this problem involves numbers m such that all sums of consecutive positive integers ending with m are not prime. The number 12 is not in the sequence because 11+12 is prime. The number 13 is not in the sequence because 13 is prime. However, 14 is in the sequence because all of the sums 14, 14+13, 14+13+12, etc. through 14+13+12+…+1 are not prime.
Write a function that returns the nth number in this sequence.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers7
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5799 Solvers
-
Find perfect placement of non-rotating dominoes (easier)
383 Solvers
-
Check if number exists in vector
13921 Solvers
-
Detect a number and replace with two NaN's
200 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
2049 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The solutions don't match the problem statement, as 1 is not composite. It should be something like:
"numbers m such that no sum of consecutive positive integers ending with m are prime".
Thanks. Changed.