A187815 Number of permutations q_1, ..., q_7 of the 7 consecutive primes p_n, p_{n+1}, ..., p_{n+6} with q_1 = p_n and q_7 = p_{n+6}, and with |q_1-q_2|, |q_2-q_3|, ..., |q_6-q_7|, |q_7-q_1| pairwise distinct, where p_k denotes the k-th prime.
10, 2, 7, 4, 10, 17, 15, 15, 17, 11, 4, 23, 33, 24, 19, 16, 24, 16, 31, 39, 39, 30, 24, 11, 15, 39, 30, 52, 66, 41, 29, 23, 48, 43, 15, 15, 43, 48, 39, 30, 30, 52, 68, 64, 68, 34, 19, 27, 39, 35, 22, 36, 32, 20, 19, 32, 38, 72, 71, 59
Offset: 1
Keywords
Examples
a(2) = 2 since there are exactly two permutations q_1,...,q_7 of 3,5,7,11,13,17,19 meeting the requirement: (q_1,...,q_7) = (3, 7, 17, 11, 13, 5, 19), (3, 11, 13, 7, 17, 5, 19).
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Noam D. Elkies, Re: A conjecture on permutations of consecutive primes, a message to Number Theory List, August 31, 2013.
Programs
-
Mathematica
V[n_,i_]:=Part[Permutations[{Prime[n+1],Prime[n+2],Prime[n+3],Prime[n+4],Prime[n+5]}],i] Do[m=0;Do[If[Length[Union[{Abs[Part[V[n,i],1]-Prime[n]]},Table[Abs[Part[V[n,i],j]-If[j<5,Part[V[n,i],j+1],Prime[n+6]]],{j,1,5}]]]<6,Goto[aa]]; m=m+1;Label[aa];Continue,{i,1,5!}];Print[n," ",m];Continue,{n,1,20}] A187815[n_] := Module[{p, c = 0, i = 1, j, q}, p = Permutations[Table[Prime[j], {j, n + 1, n + 5}]]; While[i <= Length[p], q = Join[{Prime[n]}, p[[i]], {Prime[n + 6]}]; i++; If[Length[ Union[Join[ Table[Abs[q[[j]] - q[[j + 1]]], {j, 1, 6}], {Abs[ q[[7]] - q[[1]]]}]]] == 7, c++]]; c]; Table[A187815[n], {n, 1, 60}] (* Robert Price, Apr 04 2019 *)
Comments