OFFSET
1,2
COMMENTS
A very restricted form of the prime circle problem whose sequence is A051252. This sequence lists the n for which A072617(n) is positive. See A072616 for the case where only the odd numbers or only the even numbers are in order.
There is a provable solution for n when either (a) 2n+1 and 2n+3 are prime, (b) 2k+1, 2k+3, 2k+2n+1 and 2k+2n+3 are prime for some 0 < k < n-1, or (c) 2n-1, 2n+1 and 4n-1 are primes. Part (a) is due to Mike Hennebry. Note that cases (a) and (b) involve 3 sets of twin primes. For n > 3, due to the form of twin primes, it can be shown that (a) implies not (b) and not (c).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Prime Circle.
EXAMPLE
n=6 is on the list because the simple solution is {1, 10, 3, 8, 5, 6, 7, 4, 9, 2, 11, 12}.
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<n&&allPrime, j++; allPrime= PrimeQ[oddTable[[j]]+evenTable[[i+j-1]]]&& PrimeQ[oddTable[[j+1]]+evenTable[[i+j-1]]]]; If[allPrime, cnt++ ]]; If[cnt>0, AppendTo[lst, n]]]; lst
PROG
(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
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
T. D. Noe, Jun 25 2002
EXTENSIONS
More terms from Robert G. Wilson v, Jun 28 2002
STATUS
approved