%I #18 Jan 09 2024 16:14:09
%S 0,0,3,19,107,691,4929,39958,361114,3617842,39839167,478446607,
%T 6222389995,87141729459,1307336091119,20919193567746,355645495960717,
%U 6401893756352511,121639082125097830,2432829344591803920,51089970941577272512,1123986359392616081280,25851788572429206208046,620444847283311945960411,15511151016762411683607733,403290394935411695227886859,10888849001142056697750434215,304887920401982037154914970647,8841752695810641318540928982492,265252660423388422894156833658591
%N Number of permutations p of (1,2,3,...,n) such that at least one value of abs(k-p(k)) is prime.
%o (PARI) a(n)=sum(k=1,n!,if(sum(i=1,n,isprime(abs(i-component(numtoperm(n,k)),i))),1,0))
%K nonn
%O 1,3
%A _Benoit Cloitre_, Aug 20 2002
%E More terms from _Ryan Propper_, Jul 21 2006
%E Definition corrected by Franklin T. Adams-Watters, Dec 07 2006
%E a(13)-a(14) from _Donovan Johnson_, Sep 24 2010
%E a(15)-a(30) from _Robert Gerbicz_, Nov 21 2010
|