login
Number of permutations f of {1,...,n} with f(1) = 1 such that the n numbers prime(k) + prime(f(k)) + 1 (k = 1..n) are distinct primes.
0

%I #19 Nov 16 2025 20:30:31

%S 1,1,1,0,2,2,0,4,20,88,18,0,224,0,0,1234,60428,5742,0,9276

%N Number of permutations f of {1,...,n} with f(1) = 1 such that the n numbers prime(k) + prime(f(k)) + 1 (k = 1..n) are distinct primes.

%C If f is a permutation of {1,...,n} with f(1) = 1, and the n numbers prime(k) + prime(f(k)) + 1 (k = 1..n) are distinct primes, then f^{-1} (the inverse of f) is also a permutaion of {1,...,n} with f^{-1}(1) = 1, and the n numbers prime(k) + prime(f^{-1}(k)) + 1 (k = 1..n) are distinct primes.

%H Zhi-Wei Sun, <a href="https://doi.org/10.1007/s10801-021-01028-8">On permutations of {1,...,n} and related topics</a>, J. Algebraic Combin. 54 (2021), 893-912.

%e a(5) = 2 since we can only take (f(1),...,f(5)) = (1,2,4,5,3), (1,2,5,3,4).

%e a(6) = 2 since we can only take (f(1),...,f(6)) = (1,4,6,3,5,2), (1,6,4,2,5,3).

%e a(8) = 4 since we can only take (f(1),...,f(8)) = (1,4,6,3,7,2,8,5), (1,4,6,3,8,2,5,7), (1,6,4,2,7,3,8,5), (1,6,4,2,8,3,5,7).

%e a(11) > 0 since we may take (f(1),...,f(11)) = (1,4,6,3,8,2,9,7,10,11,5). Note that prime(1) + prime(1) + 1 = 5, prime(2) + prime(4) + 1 = 11, prime(3) + prime(6) + 1 =19, prime(4) + prime(3) + 1 = 13, prime(5) + prime(8) + 1 = 31, prime(6) + prime(2) + 1 = 17, prime(7) + prime(9) + 1 = 41, prime(8) + prime(7) + 1 = 37, prime(9) + prime(10) + 1 = 53, prime(10) + prime(11) + 1 = 61 and prime(11) + prime(5) + 1 = 43.

%t A program to compute a(8):

%t p[n_]:=p[n]=Prime[n];V[i_]:=V[i]=Part[Permutations[{2,3,4,5,6,7,8}],i];

%t m=0; Do[U={};Do[q=p[j]+p[V[i][[j-1]]]+1; If[PrimeQ[q], U=Append[U, q]], {j, 2, 8}];If[Length[Union[U]]==7, m=m+1], {i, 1, 7!}];Print[m]

%Y Cf. A000040, A321727.

%K nonn,more

%O 1,5

%A _Zhi-Wei Sun_, Nov 15 2025

%E a(11)-a(20) from _Alois P. Heinz_, Nov 15 2025