OFFSET
1,2
LINKS
James Mitchell, Table of n, a(n) for n = 1..100
P. J. Cameron, M. Gadouleau, J. D. Mitchell, Y. Peresse, Chains of subsemigroups, arXiv preprint arXiv:1501.06394 [math.GR], 2015.
MATHEMATICA
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;
Array[a, 19] (* Jean-François Alcover, Dec 12 2018, from PARI *)
PROG
(PARI) b(n)=if(n<1, 0, b(n\2)+n%2) /* A000120 */
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))
CROSSREFS
KEYWORD
nonn
AUTHOR
James Mitchell, May 14 2014
STATUS
approved