login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of permutations of [n] that have no prime fixed points.
2

%I #31 Mar 08 2017 09:30:26

%S 1,1,1,3,14,64,426,2790,24024,229080,2399760,25022880,312273360,

%T 3884393520,56255149440,869007242880,14266826784000,233845982899200,

%U 4309095479673600,79300508301907200,1620482929875532800,34699018357638835200,777011144137311283200

%N Number of permutations of [n] that have no prime fixed points.

%H Alois P. Heinz, <a href="/A247978/b247978.txt">Table of n, a(n) for n = 0..400</a>

%F a(n) = Sum_{j=0..pi(n)} (-1)^(j)*C(pi(n),j)*(n-j)!, with pi = A000720.

%e a(2) = 1: 21.

%e a(3) = 3: 132, 231, 312.

%e a(4) = 14: 1324, 1342, 1423, 2143, 2314, 2341, 2413, 3124, 3142, 3412, 3421, 4123, 4312, 4321.

%p with(numtheory):

%p a:= n-> add((-1)^(j)*binomial(pi(n), j)*(n-j)!, j=0..pi(n)):

%p seq(a(n), n=0..25);

%t a[n_] := Sum[(-1)^j*Binomial[PrimePi[n], j]*(n-j)!, {j, 0, PrimePi[n]}]; Table[a[n], {n, 0, 25}] (* _Jean-François Alcover_, Feb 26 2017, translated from Maple *)

%o (PARI) for(n=0, 25, print1(sum(j=0, primepi(n), (-1)^j*binomial(primepi(n), j)*(n - j)!), ", ")) \\ _Indranil Ghosh_, Mar 08 2017

%Y Cf. A000720, A161131, A161132, A187847.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Nov 02 2014