A073451 Number of essentially different ways in which the squares 1,4,9,...,n^2 can be arranged in a sequence such that all pairs of adjacent squares sum to a prime number. Rotations and reversals are counted only once.
1, 1, 1, 1, 2, 4, 0, 12, 6, 66, 156, 44, 312, 1484, 2672, 6680, 19080, 45024, 168496, 2033271, 724543, 2776536, 24598062, 26849699, 345160845, 4478968678, 5094833662, 14184530127, 29116554754, 125878922175
Offset: 1
Examples
a(5)=2 because there are two essential different arrangements: {9,4,1,16,25} and {9,4,25,16,1}.
Links
- Carlos Rivera, Puzzle 189: Squares and primes in a row, The Prime Puzzles & Problems Connection.
Programs
-
Mathematica
nMax=12; $RecursionLimit=500; try[lev_] := Module[{t, j, circular}, If[lev>n, circular=PrimeQ[soln[[1]]^2+soln[[n]]^2]; If[(!circular&&soln[[1]]
Extensions
a(24)-a(30) from Martin Ehrenstein, Jul 19 2023
Comments