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!)
A187847 Number of permutations p of [n] with p(i) <> i^2. 2
1, 0, 1, 4, 14, 78, 504, 3720, 30960, 256320, 2656080, 30078720, 369774720, 4906137600, 69894316800, 1064341555200, 16190733081600, 279499828608000, 5100017213491200, 98087346669312000, 1983334021853184000, 42063950934061056000, 933754193111900160000 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
Also number of permutations of [n] that have no square fixed points.
LINKS
FORMULA
a(n) = Sum_{j=0..floor(sqrt(n))} (-1)^j*C(floor(sqrt(n)),j)*(n-j)!.
EXAMPLE
a(3) = 4: (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1).
MAPLE
with(LinearAlgebra):
a:= n-> `if`(n=0, 1, Permanent(Matrix(n, (i, j)-> `if`(j<>i^2, 1, 0)))):
seq(a(n), n=0..15);
# second Maple program:
a:= n->(p->add((-1)^(j)*binomial(p, j)*(n-j)!, j=0..p))(floor(sqrt(n))):
seq(a(n), n=0..25); # Alois P. Heinz, Nov 02 2014
MATHEMATICA
a[n_] := With[{p = Floor[Sqrt[n]]}, Sum[(-1)^j*Binomial[p, j]*(n-j)!, {j, 0, p}]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 25}] (* Jean-François Alcover, Jan 07 2016, adapted from Maple *)
CROSSREFS
Sequence in context: A231510 A161132 A186638 * A277039 A003707 A355950
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 11 2011
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 08:02 EDT 2024. Contains 371236 sequences. (Running on oeis4.)