%I #89 Jul 15 2023 05:40:32
%S 1,2,5,17,74,394,2484,18108,149904,1389456,14257440,160460640,
%T 1965444480,26029779840,370643938560,5646837369600,91657072281600,
%U 1579093018675200,28779361764249600,553210247226470400,11185850044938240000,237335752951879680000
%N a(n) = n!*(1 + Sum_{i=1..n} 1/i).
%C Number of {12,12*,21}-avoiding signed permutations in the hyperoctahedral group.
%C Let M be the n X n matrix with M( i, i ) = i+1, other entries = 1. Then a(n) = det(M); example: a(3) = 17 = det([2, 1, 1; 1, 3, 1; 1, 1, 4]). - _Philippe Deléham_, Jun 13 2005.
%C With offset 1: number of permutations of the n-set into at most two cycles. - _Joerg Arndt_, Jun 22 2009
%C A ball goes with probability 1/(k+1) from place k to a place j with j=0..k; a(n)/n! is the average number of steps from place n to place 0. - _Paul Weisenhorn_, Jun 03 2010
%C a(n) is a multiple of A025527(n). - _Charles R Greathouse IV_, Oct 16 2012
%H Nathaniel Johnston, <a href="/A000774/b000774.txt">Table of n, a(n) for n = 0..250</a>
%H Jean-Christophe Aval, Samuele Giraudo, Théo Karaboghossian, and Adrian Tanasa, <a href="https://arxiv.org/abs/1912.06563">Graph operads: general construction and natural extensions of canonical operads</a>, arXiv:1912.06563 [math.CO], 2019.
%H Jean-Christophe Aval, Samuele Giraudo, Théo Karaboghossian, Adrian Tanasa, <a href="https://arxiv.org/abs/2002.10926">Graph insertion operads</a>, arXiv:2002.10926 [math.CO], 2020.
%H Brant Jones, Katelynn D. Kochalski, Sarah Loeb, and Julia C. Walk, <a href="https://arxiv.org/abs/2107.04872">Strategy-indifferent games of best choice</a>, arXiv:2107.04872 [math.CO], 2021.
%H Sergey Kitaev and Jeffrey Remmel, <a href="http://arxiv.org/abs/1201.1323">Simple marked mesh patterns</a>, arXiv preprint arXiv:1201.1323 [math.CO], 2012.
%H Sergey Kitaev and Jeffrey Remmel, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL15/Kitaev/kitaev5.html">Quadrant Marked Mesh Patterns</a>, J. Int. Seq. 15 (2012) # 12.4.7.
%H C. Lenormand, <a href="/A003095/a003095.pdf">Arbres et permutations II</a>, see p. 9.
%H T. Mansour and J. West, <a href="https://arxiv.org/abs/math/0207204">Avoiding 2-letter signed patterns</a>, arXiv:math/0207204 [math.CO], 2002.
%H J. R. Stembridge, <a href="http://dx.doi.org/10.1090/S0002-9947-97-01805-9">Some combinatorial aspects of reduced words in finite Coxeter groups</a>, Trans. Amer. Math. Soc. 349 (1997), no. 4, 1285-1332.
%F E.g.f.: A(x) = (1-x)^-1 * (1 - log(1-x)).
%F a(n+1) = (n+1)*a(n) + n!. - _Jon Perry_, Sep 26 2004
%F a(n) = A000254(n) + n!. - _Mark van Hoeij_, Jul 06 2010
%F G.f.: 1+x = Sum_{n>=0} a(n) * x^n / Product_{k=1..n+1} (1 + k*x). - _Paul D. Hanna_, Mar 01 2012
%F a(n) = Sum_{k=0..n} (k+1)*|s(n,k)|, where s(n,k) are Stirling numbers of the first kind (A008275). - _Peter Luschny_, Oct 16 2012
%F Conjecture: a(n) +(-2*n+1)*a(n-1) +(n-1)^2*a(n-2)=0. - _R. J. Mathar_, Nov 26 2012
%e (1-x)^-1 * (1 - log(1-x)) = 1 + 2*x + 5/2*x^2 + 17/6*x^3 + ...
%e G.f.: 1+x = 1/(1+x) + 2*x/((1+x)*(1+2*x)) + 5*x^2/((1+x)*(1+2*x)*(1+3*x)) + 17*x^3/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)) + 74*x^4/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)*(1+5*x)) +...
%p A000774 := proc(n) local i,j; j := 0; for i to n do j := j+1/i od; (j+1)*n! end;
%p ZL :=[S, {S = Set(Cycle(Z),3 > card)}, labelled]: seq(combstruct[count](ZL, size=n), n=1..20); # _Zerinvary Lajos_, Mar 25 2008
%p a[0]:=1: p:=1: for n from 1 to 20 do
%p a[n]:=n*a[n-1]+p: p:=p*n: end do: # _Paul Weisenhorn_, Jun 03 2010
%t Table[n!(1+Sum[1/i,{i,n}]),{n,0,30}] (* _Harvey P. Dale_, Oct 03 2011 *)
%o (PARI) a(n)=n!*(1+sum(j=1,n, 1/j ));
%o (PARI) {a(n)=if(n==0, 1, polcoeff(1+x-sum(k=0, n-1, a(k)*x^k/prod(j=1, k+1, (1+j*x+x*O(x^n)) )), n))} /* _Paul D. Hanna_, Mar 01 2012 */
%Y Cf. A000254, A000776. Same as A081046 apart from signs.
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_