login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072129 Number of distinct ways of arranging the squares {1,4,9,...,(2n)^2} in a circle so that the sum of each two adjacent entries is a prime. 1
1, 0, 0, 0, 6, 0, 96, 272, 1408, 61622, 33736, 356606, 86529774 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Table of n, a(n) for n=1..13.

EXAMPLE

a(5)=6 because there are 6 essentially different ways: {1, 4, 9, 64, 49, 100, 81, 16, 25, 36}, {1, 4, 49, 64, 9, 100, 81, 16, 25, 36}, {1, 16, 81, 100, 9, 4, 49, 64, 25, 36}, {1, 16, 81, 100, 9, 64, 49, 4, 25, 36}, {1, 16, 81, 100, 49, 4, 9, 64, 25, 36} and {1, 16, 81, 100, 49, 64, 9, 4, 25, 36}

MATHEMATICA

$RecursionLimit=500; try[lev_] := Module[{t, j}, If[lev>2n, (*then make sure the sum of the first and last is prime*) If[PrimeQ[soln[[1]]^2+soln[[2n]]^2]&&soln[[2]]<=soln[[2n]], (*Print[soln]; *) cnt++ ], (*else append another number to the soln list*) t=soln[[lev-1]]; For[j=1, j<=Length[s[[t]]], j++, If[ !MemberQ[soln, s[[t]][[j]]], soln[[lev]]=s[[t]][[j]]; try[lev+1]; soln[[lev]]=0]]]]; For[lst={}; n=1, n<=7, n++, s=Table[{}, {2n}]; For[i=1, i<=2n, i++, For[j=1, j<=2n, j++, If[i!=j&&PrimeQ[i^2+j^2], AppendTo[s[[i]], j]]]]; soln=Table[0, {2n}]; soln[[1]]=1; cnt=0; try[2]; AppendTo[lst, cnt]]; lst

CROSSREFS

Cf. A051252, A073451.

Sequence in context: A245086 A145223 A219948 * A085511 A187525 A187696

Adjacent sequences:  A072126 A072127 A072128 * A072130 A072131 A072132

KEYWORD

nonn

AUTHOR

Santi Spadaro, Jun 25 2002

EXTENSIONS

Corrected and extended by T. D. Noe, Jul 03 2002

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 26 02:35 EDT 2019. Contains 323579 sequences. (Running on oeis4.)