A072618 Numbers n for which the prime circle problem has a simple solution: the arrangement of numbers 1 through 2n around a circle is such that the sum of each pair of adjacent numbers is prime and the odd and even numbers are in order in opposite directions.
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 18, 19, 20, 21, 24, 27, 28, 29, 30, 33, 34, 35, 36, 39, 42, 45, 48, 49, 50, 51, 52, 53, 54, 60, 63, 66, 67, 68, 69, 72, 73, 74, 75, 78, 81, 84, 87, 88, 89, 90, 93, 94, 95, 96, 97, 98, 99, 102, 105, 108, 111, 112, 113, 114, 117, 118
Offset: 1
Examples
n=6 is on the list because the simple solution is {1, 10, 3, 8, 5, 6, 7, 4, 9, 2, 11, 12}.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
- Eric Weisstein's World of Mathematics, Prime Circle.
Programs
-
Haskell
import Data.List (transpose) a072618 n = a072618_list !! (n-1) a072618_list = filter f [1 ..] where f x = any (all ((== 1) . a010051' . fromIntegral)) $ map cs [concat $ transpose [[2*x, 2*x-2 .. 2] , us] | us <- map (uncurry (++) . (uncurry $ flip (,)) . flip splitAt [1, 3 .. 2 * x]) [1 .. x]] cs zs = (head zs + last zs) : zipWith (+) zs (tail zs) -- Reinhard Zumkeller, Mar 17 2013
-
Mathematica
For[lst={}; n=1, n<=100, n++, oddTable=Append[Table[2i-1, {i, n}], 1]; evenTable=Table[2n+2-2i, {i, n}]; evenTable=Join[evenTable, evenTable]; For[cnt=0; i=1, i<=n, i++, j=0; allPrime=True; While[j
0, AppendTo[lst, n]]]; lst
Extensions
More terms from Robert G. Wilson v, Jun 28 2002
Comments