Write in a line the numbers from 1 to 15 in such a way that the sum of any two adjacent numbers in this line is a perfect square.
With numbers from 1 to 15, the sum of two adjacent numbers is at least 3 and at most 29. The squares of integers from 3 to 29 are only 4, 9, 16, and 25. Let's check which numbers from 1 to 15 can be adjacent, or "neighbors."

| Numbers | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Possible Neighbors | 3 | 7 | 1 | 5 | 4 | 3 | 2 | 1 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|  | 8 | 14 | 6 | 12 | 11 | 10 | 9 |  |  | 15 | 14 | 13 | 12 | 11 | 10 |
|  | 15 |  | 13 |  |  |  |  |  |  |  |  |  |  |  |  |

The numbers 8 and 9 each have only one possible neighbor, so they must be placed at the beginning and the end of the line, followed by their only neighbors.

| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 7 | 9 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |

The remaining numbers are 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, and 15. In the "neighbor table," we see that next to 7, we can only place 2, and next to 2, only 14. We then have:

| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 14 | 2 | 7 | 9 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |

Consulting the "neighbor table" and the remaining numbers, we arrive at the solution.

| 8 | 1 | 15 | 10 | 6 | 3 | 13 | 12 | 4 | 5 | 11 | 14 | 2 | 7 | 9 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |

See the step-by-step solution below.

| Formation of the line at each stage |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :--- |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 7 | 9 | $2,3,4,5,6,10,11,12,13,14,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 2 | 7 | 9 | $3,4,5,6,10,11,12,13,14,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 14 | 2 | 7 | 9 | $3,4,5,6,10,11,12,13,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 5 | 11 | 14 | 2 | 7 | 9 | $3,4,6,10,12,13,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | $?$ | 4 | 5 | 11 | 14 | 2 | 7 | 9 | $3,6,10,12,13,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | $?$ | 12 | 4 | 5 | 11 | 14 | 2 | 7 | 9 | $3,6,10,13,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | $?$ | 13 | 12 | 4 | 5 | 11 | 14 | 2 | 7 | 9 | $3,6,10,15$ |
| 8 | 1 | $?$ | $?$ | $?$ | 3 | 13 | 12 | 4 | 5 | 11 | 14 | 2 | 7 | 9 | $6,10,15$ |
| 8 | 1 | 15 | 10 | 6 | 3 | 13 | 12 | 4 | 5 | 11 | 14 | 2 | 7 | 9 | Answer |