|
|
A103687
|
|
Number of permutations p of (1,2,...,n) such that 1+k+p(k) is prime for all k=1,2,...,n.
|
|
0
|
|
|
1, 1, 2, 2, 3, 6, 12, 36, 156, 520, 1920, 5760, 12600, 39900, 210140, 844984, 2871876, 8784783, 29392449, 123405524, 726794464, 3669378736, 20998365592, 139906305272, 770298602024, 4979077340664, 35706521898618, 187318543647373, 1117410697347693, 7335115455487050, 46292557037334300
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
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+1 is prime or composite respectively. - T. D. Noe, Oct 16 2007
|
|
EXAMPLE
|
a(3)=2 because we have 123 (1+1+1, 1+2+2, 1+3+3 are all prime) and 321 (1+1+3, 1+2+2, 1+3+1 are all prime).
|
|
MAPLE
|
with(combinat): a:=proc(n) local P, ct, i: P:=permute(n): ct:=0: for i from 1 to n! do if [seq(isprime(1+j+P[i][j]), j=1..n)]=[seq(true, i=1..n)] then ct:=ct+1 else ct:=ct fi od:end: seq(a(n), n=1..8);
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|