cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Aug 02 2002

Keywords

Comments

Note that when the first and last numbers of an arrangement sum to a prime, then there are n rotations that are treated as one arrangement. The case n=10 exhibits the first of these rotational solutions: {1,4,9,64,49,100,81,16,25,36}. The Mathematica program uses a backtracking algorithm to count the arrangements. To print the unique arrangements, remove the comments from around the print statement.

Examples

			a(5)=2 because there are two essential different arrangements: {9,4,1,16,25} and {9,4,25,16,1}.
		

Crossrefs

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