All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Square pairs (Posted on 2005-01-09)
Back in An Arrangement of 15 you were asked to place the numbers 1 to 15 in a line so that any two adjacent numbers summed to a square number.

Now, try to arrange the numbers from 1 to 32 in a circle, so any two adjacent numbers again sum a square number.

 See The Solution Submitted by e.g. Rating: 4.3333 (12 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Computer Solution--Spoiler | Comment 3 of 12 |

The numbers, and the total of each number with the number before:

` 1  915 1610 2526 3623 49 2 2514 1622 3627 49 9 3616 2520 3629 49 7 3618 2531 49 5 3611 1625 3624 4912 3613 25 3 16 6  930 3619 4917 3632 49 4 3621 2528 49 8 36`

This is one of two found by the following program.  The other is just the reverse of this one.

CLEAR , , 5000
DIM SHARED posn(32), used(32)
CLS

posn(1) = 1: used(1) = 1

FOR i = 2 TO 32
IF used(i) = 0 THEN
t = posn(p - 1) + i
sqroot = INT(SQR(t) + .5)
IF sqroot * sqroot = t THEN
posn(p) = i
IF p = 32 THEN
t = posn(1) + posn(32)
sqroot = INT(SQR(t) + .5)
IF sqroot * sqroot = t THEN
FOR j = 1 TO 32
IF j = 1 THEN k = 32:  ELSE k = j - 1
PRINT USING "###"; posn(j); posn(j) + posn(k)
NEXT
PRINT
END IF
ELSE
used(i) = 1
used(i) = 0
END IF
END IF
END IF
NEXT
END SUB

 Posted by Charlie on 2005-01-09 19:25:52

 Search: Search body:
Forums (0)