%I #31 Aug 24 2021 05:40:35
%S 0,1,4,10,48,216,1440,9360,80640,685440,7257600,76204800,958003200,
%T 11975040000,174356582400,2528170444800,41845579776000,
%U 690452066304000,12804747411456000,236887827111936000,4865804016353280000,99748982335242240000,2248001455555215360000
%N Total number of points in all permutations of [n] that are fixed or reflected.
%C A permutation p of [n] has fixed point j if p(j) = j, it has reflected point j if p(n+1-j) = j. A point can be fixed and reflected at the same time.
%H Alois P. Heinz, <a href="/A335873/b335873.txt">Table of n, a(n) for n = 0..450</a>
%H T. Simpson, <a href="/A007016/a007016.pdf">Permutations with unique fixed and reflected points</a>, Preprint. (Annotated scanned copy)
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a>
%F E.g.f.: 2*x/(1-x) - (log(1+x) - log(1-x))/2.
%F a(0) = 0, a(n) = 2*n! - (n mod 2)*(n-1)! for n > 0.
%F a(n) = (n-1)*(4*a(n-1)+(n-2)*(4*n-3)*a(n-2))/(4*n-7) for n >= 2, a(n) = n for n < 2.
%F a(n) = Sum_{k=1..n} k * A335872(n,k).
%e a(3) = 10: (1)(2)(3), (1)32, 21(3), 23(1), (3)12, (3)(2)(1).
%p b:= proc(s, i) option remember; (n-> `if`(n=0, [1, 0],
%p add((p-> p+[0, `if`(j in {i, n}, p[1], 0)])(
%p b(s minus {j}, i+1)), j=s)))(nops(s))
%p end:
%p a:= n-> b({$1..n}, 1)[2]:
%p seq(a(n), n=0..14);
%p # second Maple program:
%p a:= n-> `if`(n=0, 0, 2*n! -`if`(n::odd, (n-1)!, 0)):
%p seq(a(n), n=0..22);
%p # third Maple program:
%p a:= proc(n) option remember; `if`(n<2, n, (n-1)*
%p (4*a(n-1)+(n-2)*(4*n-3)*a(n-2))/(4*n-7))
%p end:
%p seq(a(n), n=0..22);
%t a[n_] := If[n == 0, 0, 2 n! - If[OddQ[n], (n-1)!, 0]];
%t Table[a[n], {n, 0, 22}] (* _Jean-François Alcover_, Aug 24 2021, from 2nd Maple program *)
%Y Bisection (even part) gives 2 * A010050(n) for n>0.
%Y Cf. A000142, A005359, A306258, A335872.
%K nonn,easy
%O 0,3
%A _Alois P. Heinz_, Jun 28 2020
|