Create Circular Perfect Square Sequence - MATLAB Cody - MATLAB Central

Problem 633. Create Circular Perfect Square Sequence

Difficulty:Rate

A sequence v(1:N) made of values 1:N can be created for N>31 such that v(i)+v(i+1) is a perfect square. The sum of v(N)+v(1) must also be a perfect square. All values 1 thru N are required and the vector must be of length N. (e.g. For N=32 the possible perfect squares are [4 9 16 25 36 49]. By inspection the value 32 must be bracketed by 4 and 17). The Test set will be limited to 31<N<52 as solutions beyond 51 may take significant processing time.

Solution Stats

57.14% Correct | 42.86% Incorrect
Last Solution submitted on Jul 07, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers10

Suggested Problems

More from this Author308

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!