MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodayA 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.

6 correct solutions
10 incorrect solutions

Last solution submitted on Sep 06, 2013

1 player likes this problem

1 Comment

Alfonso Nieto-Castanon
on 29 Dec 2012

a bit faster (median t=0.56s for 31<N<52 on my machine)

5 Comments