Problem 53064. Amazing circle of numbers 1 to n
For given natural number n, create amazing circle of numbers 1 to n without a repeat.
This circle is that the sum of any two adjacent numbers is a perfect square.
For example, if n = 32,
So, output is
[1 8 28 21 4 32 17 19 30 6 3 13 12 24 25 11 5 31 18 7 29 20 16 9 27 22 14 2 23 26 10 15]
If the condition is satisfied, it is the correct answer regardless of the order of the vectors.
If there is no amazing circle vector, return empty vector [].
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Project Euler: Problem 1, Multiples of 3 and 5
3424 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2347 Solvers
-
Poker Series 11: selectBestHand
35 Solvers
-
Mastermind I: Solve all 1296 cases
17 Solvers
-
47 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!