A185645 Number of permutations q_1,...,q_n of the first n primes p_1,...,p_n with q_1 = p_1 = 2 and q_n = p_n, and with |q_1-q_2|, |q_2-q_3|, ..., |q_{n-1}-q_n|, and |q_n-q_1| (if n>2) pairwise distinct.
1, 1, 1, 1, 3, 5, 10, 33, 153, 1060, 7337, 51434, 440728, 3587067, 28498105, 271208386, 3014400869, 35358507494
Offset: 1
Examples
a(4) = 1 since (q_1,q_2,q_3,q_4) = (2,5,3,7) is the only suitable permutation. a(5) = 3 since there are exactly three suitable permutations(q_1,q_2,q_3,q_4,q_5): (2,3,7,5,11), (2,5,7,3,11) and (2,7,3,5,11). a(6) = 5 since there are exactly five suitable permutations (q_1,q_2,q_3,q_4,q_5,q_6): (2,5,3,11,7,13), (2,5,7,11,3,13), (2,7,5,11,3,13), (2,7,11,5,3,13), (2,11,5,7,3,13). a(7) = 10, and the ten suitable permutations (q_1,...,q_7) are as follows: (2,3,13,5,7,11,17), (2,7,3,13,11,5,17), (2,7,5,11,3,13,17), (2,7,11,5,13,3,17), (2,11,3,13,7,5,17), (2,11,7,5,13,3,17), (2,11,7,13,3,5,17), (2,11,7,13,5,3,17), (2,13,3,11,7,5,17), (2,13,7,11,3,5,17).
Links
- Z.-W. Sun, Some new problems in additive combinatorics, arXiv preprint arXiv:1309.1679 [math.NT], 2013-2014.
Programs
-
Mathematica
A185645[n_] := Module[{p, c = 0, i = 1, j, q}, If[n == 2, Return[1], p = Permutations[Table[Prime[j], {j, 2, n - 1}]]; While[i <= Length[p], q = Join[{2}, p[[i]], {Prime[n]}]; i++; If[Length[Union[Join[Table[Abs[q[[j]] - q[[j + 1]]], {j, 1, n - 1}], {Abs[q[[n]] - q[[1]]]}]]] == n, c++]]; c]]; Table[A185645[n], {n, 1, 11}] (* Robert Price, Apr 04 2019 *)
Extensions
Name clarified by Robert Price, Apr 04 2019
a(12)-a(18) from Bert Dobbelaere, Sep 08 2019
Comments