Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The Square-Sum Chain problem

38 views
Skip to first unread message

Joachim Schimpf

unread,
Feb 5, 2018, 3:13:56 PM2/5/18
to
A couple of days ago, the Square-Sum Chain problem appeared as a
programming challenge on Reddit https://redd.it/7t6fnc, with
further explanations at https://www.youtube.com/watch?v=G1m7goLCJDY
and related Prolog-specific discussion at
https://stackoverflow.com/questions/48532121/infinite-loop-in-prolog-or-just-very-slow

The challenge is to order numbers 1 to N such that every two consecutive
numbers in the sequence add up to a square number. For N=15 a solution is
8 1 15 10 6 3 13 12 4 5 11 14 2 7 9.

I went a bit overboard exploring a couple of approaches in ECLiPSe,
which some of you may find interesting. Read about it at

http://eclipseclp.org/wiki/Examples/SquareSumChain


Cheers,
Joachim

Julio Di Egidio

unread,
Feb 6, 2018, 1:32:45 PM2/6/18
to
Thanks, makes one think. I would propose (in my ever limited knowledge of
this language) that Prolog+CLP is a multi-paradigm language...

Julio

burs...@gmail.com

unread,
Feb 7, 2018, 1:23:55 PM2/7/18
to
Where would you recommend looking for a SAT Solver in
ECLiPSe Prolog? Are there efforts under way to translate

for example a CLP(FD) problem into a SAT problem?
0 new messages