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.

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.

This page as a plain text file.
%I A072618 #15 Feb 16 2025 08:32:46
%S A072618 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,
%T A072618 39,42,45,48,49,50,51,52,53,54,60,63,66,67,68,69,72,73,74,75,78,81,84,
%U A072618 87,88,89,90,93,94,95,96,97,98,99,102,105,108,111,112,113,114,117,118
%N 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.
%C A072618 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.
%C A072618 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).
%H A072618 Reinhard Zumkeller, <a href="/A072618/b072618.txt">Table of n, a(n) for n = 1..1000</a>
%H A072618 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeCircle.html">Prime Circle.</a>
%e A072618 n=6 is on the list because the simple solution is {1, 10, 3, 8, 5, 6, 7, 4, 9, 2, 11, 12}.
%t A072618 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
%o A072618 (Haskell)
%o A072618 import Data.List (transpose)
%o A072618 a072618 n = a072618_list !! (n-1)
%o A072618 a072618_list = filter f [1 ..] where
%o A072618    f x = any (all ((== 1) . a010051' . fromIntegral)) $
%o A072618          map cs [concat $ transpose [[2*x, 2*x-2 .. 2] , us] |
%o A072618                  us <- map (uncurry (++) . (uncurry $ flip (,))
%o A072618                             . flip splitAt [1, 3 .. 2 * x]) [1 .. x]]
%o A072618    cs zs = (head zs + last zs) : zipWith (+) zs (tail zs)
%o A072618 -- _Reinhard Zumkeller_, Mar 17 2013
%Y A072618 Cf. A051252, A072616, A072617.
%Y A072618 Cf. A010051.
%K A072618 nice,nonn
%O A072618 1,2
%A A072618 _T. D. Noe_, Jun 25 2002
%E A072618 More terms from _Robert G. Wilson v_, Jun 28 2002