%I #25 Feb 26 2023 13:56:02
%S 0,0,0,0,1,3,2,27,44,154,1687,2925
%N Number of permutations tau of {1,...,n} with tau(1) = 1 and tau(2) = 2 such that Product_{k=1..n} k^tau(k) = (p-1)^3 for some prime p.
%C Conjecture 1: a(n) > 0 for all n > 5.
%C Conjecture 2: For any integer n > 5, there is a permutation tau of {1,...,n} with tau(1) = n - 1 and tau(n) = n such that tau(1)^tau(2)*...*tau(n-1)^tau(n)*tau(n)^tau(1) = q^2 for some integer q with q - 1 and q + 1 twin prime.
%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., 2021.
%e a(6) = 1, and 1^1 * 2^2 * 3^5 * 4^6 * 5^3 * 6^4 = (8461-1)^3 with 8461 prime.
%t (* A program to compute a(8): *)
%t CQ[n_]:=CQ[n]=IntegerQ[n^(1/3)]&&PrimeQ[n^(1/3)+1]
%t V[i_]:=V[i]=Part[Permutations[{3,4,5,6,7,8}], i]
%t S[i_]:=S[i]=4*Product[(j+2)^(V[i][[j]]),{j,1,6}]
%t n=0;Do[If[CQ[S[i]],n=n+1],{i,1,6!}];Print[8," ",n]
%Y Cf. A000040, A000290, A000578, A014574, A342965, A342966.
%K nonn,more
%O 2,6
%A _Zhi-Wei Sun_, Apr 05 2021
%E a(12)-a(13) from _David A. Corneth_, Apr 06 2021