OFFSET
1,4
COMMENTS
a(n)=permanent(m), where the n X n matrix m is defined by m(i,j) = 1 or 0, depending on whether i+j is prime or composite respectively. - T. D. Noe, Oct 16 2007
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..50
Paul Bradley, Prime Number Sums, arXiv:1809.01012 [math.GR], 2018.
Zhi-Wei Sun, On permutations of {1, ..., n} and related topics, arXiv:1811.10503 [math.CO], 2018.
MATHEMATICA
am[n_] := Permanent[Array[Boole[PrimeQ[2 #1 + 2 #2 - 1]]&, {n, n}]];
ap[n_] := Permanent[Array[Boole[PrimeQ[2 #1 + 2 #2 + 1]]&, {n, n}]];
a[n_] := If[n == 1, 1, If[EvenQ[n], am[n/2]^2, ap[(n-1)/2]^2]];
Array[a, 28] (* Jean-François Alcover, Nov 03 2018 *)
PROG
(PARI) a(n)=sum(k=1, n!, n==sum(i=1, n, isprime(i+component(numtoperm(n, k), i))))
(PARI) a(n)={matpermanent(matrix(n, n, i, j, isprime(i + j)))} \\ Andrew Howroyd, Nov 03 2018
(Haskell)
a073364 n = length $ filter (all isprime)
$ map (zipWith (+) [1..n]) (permutations [1..n])
where isprime n = a010051 n == 1 -- cf. A010051
-- Reinhard Zumkeller, Mar 19 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 23 2002
EXTENSIONS
a(10) from Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 14 2004
a(11) from Rick L. Shepherd, Mar 17 2004
a(12)-a(17) from John W. Layman, Jul 21 2004
More terms from T. D. Noe, Oct 16 2007
STATUS
approved