OFFSET
1,6
LINKS
Martin Fuller, Table of n, a(n) for n = 1..70
FORMULA
a(2n) = A071058(2n).
EXAMPLE
a(6)=2 because there are two ways: 2+9, 4+7, 6+11 and 2+11, 4+9, 6+7.
MAPLE
f:= proc(n) local m;
m:= floor(n/2);
LinearAlgebra:-Permanent(Matrix(m, m,
(i, j) -> `if`(isprime((i+j-2)*2 + n + 3 + (n mod 2)), 1, 0)))
end proc:
f(1):= 1:
map(f, [$1..40]); # Robert Israel, Sep 21 2023
MATHEMATICA
a[n_] := a[n] = If[n == 1, 1, Module[{s1, s2, s3, s4, i, ik, km},
s1 = Select[Flatten[Outer[List, Range[2, n, 2], Range[2n-1, n+1, -2]], 1], PrimeQ[Total[#]]&];
s2 = SplitBy[s1, First];
km = Length[s2];
ik = Table[{i[k], 1, Length[s2[[k]]]}, {k, 1, km}];
s3 = Table[Table[s2[[k, i[k]]], {k, 1, km}], Evaluate[Sequence @@ ik]] // Flatten[#, km - 1]&;
s4 = Select[s3, Length[Union[Flatten[#]]] == 2km&];
s4 // Length]];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 20}] (* Jean-François Alcover, Aug 10 2022 *)
PROG
(PARI) a(n)=matpermanent(matrix(n\2, n\2, i, j, isprime((i+j-2)*2+n+3+(n%2)))); \\ Martin Fuller, Sep 21 2023
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
T. D. Noe, May 25 2002
EXTENSIONS
More terms from David W. Wilson, May 27 2002
a(31)-a(37) from Donovan Johnson, Aug 12 2010
STATUS
approved