Let \$n > 0\$. Let \$X = 1, 2,...,n\$ and \$Y = n+1, n+2, ..., 2n\$. Define \$a(n)\$ as the number of permutations \$p\$ of \$Y\$ such that every element of \$X + p(Y)\$ is prime. For example:
n = 2
X = [1,2]
Y = [3,4]
p_0(Y) = [3,4] => X + p0(Y) = [4,6] => No
p_1(Y) = [4,3] => X + p1(Y) = [5,5] => Yes
a(2) = 1
In as few bytes as possible, write a program or function which produces this sequence (A070897), either as an infinite list on STDOUT, or in your interpreter of choice.
The output should start at \$n=1\$, and each entry should be on a newline and undecorated, i.e.:
1
1
1
1
2
...
Examples
\$a(1)=1\$ because each list [1]
, [2]
has only 1 element
\$a(5)=2\$ because there are two permutations: [(1,10),(2,9),(3,8),(4,7),(5,6)]
and [(1,6),(2,9),(3,10),(4,7),(5,8)]
Rules
No built-in primality tests. No lookup table ;). No standard loopholes.
N
elements of the list... \$\endgroup\$