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
Solution Comments
Show comments
Loading...
Problem Recent Solvers9
Suggested Problems
-
Sum all integers from 1 to 2^n
17885 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
560 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
693 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
14137 Solvers
-
427 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
See also Cody Problem 46050 for a related challenge.