In this image from a numberphile video we see a sequence of numbers from 1 to 15 without repeats where any pair of neighbouring digits sum together to make a perfect square number.
15 is the lowest value where this can be made to work. Adding 16 to the end also works but 1 to 15 is the smallest.
Question
Is it possible to arrange the digits from 1 to n where the sum of any 3 digits along the line is always a perfect square and what is the lowest value of n if it is possible?
Example Start
1 3 5 8 12 16 11 9.
Here we have 11 + 9 is 20 we can't use 16 again to get to 36 so the only option would be 29 to get to 49.
1 3 5 8 12 16 11 9 29 26 9 14 2 20 27 17 20
And so on the highest value in the above sequence is 29 but the next value has to be 44 meaning that all the digits below 44 must appear in the rest of the sequence somewhere.
Will the sequence always require a higher value making a consecutive sequence of numbers impossible?