login
A072950
Number of permutations p of (1,2,3,...,n) such that at least one value of abs(k-p(k)) is prime.
0
0, 0, 3, 19, 107, 691, 4929, 39958, 361114, 3617842, 39839167, 478446607, 6222389995, 87141729459, 1307336091119, 20919193567746, 355645495960717, 6401893756352511, 121639082125097830, 2432829344591803920, 51089970941577272512, 1123986359392616081280, 25851788572429206208046, 620444847283311945960411, 15511151016762411683607733, 403290394935411695227886859, 10888849001142056697750434215, 304887920401982037154914970647, 8841752695810641318540928982492, 265252660423388422894156833658591
OFFSET
1,3
PROG
(PARI) a(n)=sum(k=1, n!, if(sum(i=1, n, isprime(abs(i-component(numtoperm(n, k)), i))), 1, 0))
CROSSREFS
Sequence in context: A323919 A089164 A323290 * A240123 A130425 A334976
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 20 2002
EXTENSIONS
More terms from Ryan Propper, Jul 21 2006
Definition corrected by Franklin T. Adams-Watters, Dec 07 2006
a(13)-a(14) from Donovan Johnson, Sep 24 2010
a(15)-a(30) from Robert Gerbicz, Nov 21 2010
STATUS
approved