%I #20 Dec 12 2018 03:16:57
%S 0,2,17,180,3298,88431,3064050,130905678,6732227475,409094032964,
%T 28917250469178,2346562701385648,216180120430479731,
%U 22397392442055209003,2588479398843886168171,331352273262513644199134,46692196905193286953380160,7203294536351261350956567853,1210694223244114528129261255186
%N Length of longest chain of nonempty proper subsemigroups of the dual symmetric inverse monoid.
%H James Mitchell, <a href="/A242428/b242428.txt">Table of n, a(n) for n = 1..100</a>
%H P. J. Cameron, M. Gadouleau, J. D. Mitchell, Y. Peresse, <a href="http://arxiv.org/abs/1501.06394">Chains of subsemigroups</a>, arXiv preprint arXiv:1501.06394 [math.GR], 2015.
%t a[n_] := Sum[StirlingS2[n, i] (i! (StirlingS2[n, i] - 1)/2 - DigitCount[i, 2, 1] + Ceiling[3 i/2] + 1), {i, 1, n}] - n - 1;
%t Array[a, 19] (* _Jean-François Alcover_, Dec 12 2018, from PARI *)
%o (PARI) b(n)=if(n<1, 0, b(n\2)+n%2) /* A000120 */
%o a(n)=-n-1+sum(i=1, n, stirling(n,i,flag=2)*(ceil(3*i/2)-b(i)+1+(stirling(n,i,flag=2)-1)*i!/2))
%Y Cf. A007238, A227914, A023997.
%K nonn
%O 1,2
%A _James Mitchell_, May 14 2014