Problem 57815. List numbers such that every sum of consecutive positive integers ending in those numbers is composite
The sequence in question in this problem involves numbers m such that all sums of consecutive positive integers ending with m are composite. 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 composite.
Write a function that returns the nth number in this sequence.
Solution Stats
Problem Comments
-
1 Comment
GeeTwo
on 5 Dec 2024
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".
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Project Euler: Problem 9, Pythagorean numbers
1293 Solvers
-
399 Solvers
-
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
136 Solvers
-
99 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
381 Solvers
More from this Author290
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!