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.

Showing 1-3 of 3 results.

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

A182540 Number of ways of arranging the numbers 1 through n on a circle so that no sum of two adjacent numbers is prime, up to rotations and reflections.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 6, 44, 208, 912, 8016, 61952, 671248, 8160620, 87412258, 888954284, 12156253488, 180955852060, 2907927356451, 50317255621843, 802326797235038, 12251146829850324, 233309934271940028, 4243527581615332664, 79533825261873435894, 1602629887788636447221, 30450585799991840921483, 622433536382831426225696, 14891218890120375419560713, 344515231090957672408413959
Offset: 1

Views

Author

Jens Voß, May 04 2012

Keywords

Examples

			If n < 6, then in every arrangement of the numbers 1 through n on a circle, there are two adjacent numbers adding up to a prime. For n = 6, the only arrangement without a prime sum is (1, 3, 6, 2, 4, 5).
		

Crossrefs

Extensions

a(15)-a(17) from Alois P. Heinz, May 04 2012
a(18) from R. H. Hardin, May 07 2012
a(19)-a(30) from Max Alekseyev, Aug 19 2013

A074063 a(n) is the number of essentially different ways in which the integers 1,2,3,...,n can be arranged in a sequence such that (1) adjacent integers sum to a prime number and (2) squares of adjacent numbers sum to a prime number. Rotations and reversals are counted only once.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1481, 4266, 0, 0, 5624, 0
Offset: 1

Views

Author

T. D. Noe, Aug 17 2002

Keywords

Comments

It is known that a(n) > 0 for 58 <= n <= 200. It is conjectured that a(n) > 0 for all n > 57. A greedy algorithm can be used to quickly find a solution for many n. See the link to puzzle 189 for more details. The Mathematica program uses a backtracking algorithm to count the arrangements. To print the unique arrangements, remove the comments from around the print statement.
a(58) > 2.65*10^6; a(59) > 4.45*10^6. - Alexander D. Healy, Apr 07 2025

Examples

			a(4)=1 because there is essentially one arrangement: {3,2,1,4}.
		

Crossrefs

Programs

  • Mathematica
    nMax=12; $RecursionLimit=500; try[lev_] := Module[{t, j, circular}, If[lev>n, circular=PrimeQ[soln[[1]]^2+soln[[n]]^2]&&PrimeQ[soln[[1]]+soln[[n]]]; If[(!circular&&soln[[1]]
    				

Extensions

a(52)-a(57) from Alexander D. Healy, Apr 01 2025
Showing 1-3 of 3 results.