A247978 Number of permutations of [n] that have no prime fixed points.
1, 1, 1, 3, 14, 64, 426, 2790, 24024, 229080, 2399760, 25022880, 312273360, 3884393520, 56255149440, 869007242880, 14266826784000, 233845982899200, 4309095479673600, 79300508301907200, 1620482929875532800, 34699018357638835200, 777011144137311283200
Offset: 0
Keywords
Examples
a(2) = 1: 21. a(3) = 3: 132, 231, 312. a(4) = 14: 1324, 1342, 1423, 2143, 2314, 2341, 2413, 3124, 3142, 3412, 3421, 4123, 4312, 4321.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..400
Programs
-
Maple
with(numtheory): a:= n-> add((-1)^(j)*binomial(pi(n), j)*(n-j)!, j=0..pi(n)): seq(a(n), n=0..25);
-
Mathematica
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 *)
-
PARI
for(n=0, 25, print1(sum(j=0, primepi(n), (-1)^j*binomial(primepi(n), j)*(n - j)!), ", ")) \\ Indranil Ghosh, Mar 08 2017
Formula
a(n) = Sum_{j=0..pi(n)} (-1)^(j)*C(pi(n),j)*(n-j)!, with pi = A000720.