Filling array with numbers from given range so that sum of adjacent numbers is square number

Posted by REACHUS on Programmers See other posts from Programmers or by REACHUS
Published on 2012-11-04T14:55:02Z Indexed on 2012/11/04 23:16 UTC
Read the original article Hit count: 324

Filed under:
|

Problem: Fill all the cells using distinct numbers from <1,25> set, so that sum of two adjacent cells is a square number.

enter image description here

(source: http://grymat.im.pwr.wroc.pl/etap1/zad1etp1213.pdf; numbers 20 and 13 have been given)

I've already solved this problem analytically and now I would like to approach it using an algorithm.

I would like to know how should I approach these kind of problems in general (not a solution, just a point for me to start).

© Programmers or respective owner

Related posts about algorithms

Related posts about numbers