login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Sequence in context: A307241 A064674 A095902 * A166678 A032908 A192366
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Mar 27 2005
EXTENSIONS
More terms from Ryan Propper, Mar 29 2007
More terms from T. D. Noe, Oct 16 2007
a(21)-a(31) from Robert Gerbicz, Nov 27 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 11:59 EDT 2024. Contains 371254 sequences. (Running on oeis4.)