Problem 54295. prime consecutive sums
Create a number sequence of 1 to n, such that the sums of every two consecutive numbers are all primes.
E.g. if n = 5, you may write the sequence as 1,4,3,2,5 or 3,4,1,2,5
if n = 6, you may wrtie the sequence as 2,3,4,1,6,5
The answer is not unique, so one correct answer enough.
Solution Stats
Problem Comments
-
1 Comment
ChrisR
on 19 Apr 2022
See also Cody Problem 46050 for a related challenge.
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
Return the 3n+1 sequence for n
7909 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
367 Solvers
-
Generate N equally spaced intervals between -L and L
836 Solvers
-
Split a string into chunks of specified length
1457 Solvers
-
300 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!