OFFSET
1,4
COMMENTS
a(1) = 1, for n >= 2: a(n) = sum of previous terms * (n-2) = (Sum_(i=1...n-2) a(i)) * (n-2). a(n) = A001563(n-2) = A094258(n-1) for n >= 3. - Jaroslav Krizek, Oct 16 2009
LINKS
FORMULA
a(n) = (n-2)!(n-2) for n>=2. - Emeric Deutsch, May 01 2008
G.f.: x*T(0), where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2 - (1 -x -2*x*k)*(1 -3*x -2*x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 10 2013
a(n) = S1(n,1) - S1(n-1,1), where S1 are the unsigned Stirling cycle numbers. - Peter Luschny, Apr 10 2016
a(n) = A122974(n-1,n-1). - Alois P. Heinz, Nov 24 2019
EXAMPLE
a(2) = 0 as there is only one previous term and empty sum is taken to be 0.
a(4) = (a(1) +a(2))+ (a(1) +a(3)) + (a(2) +a(3)) = (1+0) +(1+1) +(0+1) = 4.
a(5) = (a(1)+a(2)+a(3)) +(a(1)+a(2)+ a(4)) +(a(1)+a(3)+a(4)) +(a(2)+a(3)+a(4)) = (1+0+1) +(1+0+4) +(1+1+4) +(0+1+4) = 2 + 5 + 6 + 5 = 18.
MAPLE
a := n -> (n-2)*(n-2)!: 1, seq(a(n), n=2..23); # Emeric Deutsch, May 01 2008
MATHEMATICA
In[2]:= l = {1}; Do[k = Length[l] - 1; p = Plus @@ Flatten[Select[Subsets[l], Length[ # ]==k& ]]; AppendTo[l, p], {n, 20}]; l (* Ryan Propper, May 28 2006 *)
PROG
(PARI) v=vector(30); v[1]=1; v[2]=0; for(n=3, #v, s=0; for(i=1, 2^(n-1)-1, vb=binary(i); if(hammingweight(vb)==n-2, s=s+sum(j=1, #vb, if(vb[j], v[n-#vb+j-1])))); v[n]=s; print1(s, ", ")) /* Ralf Stephan, Sep 22 2013 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 29 2004
EXTENSIONS
Edited by N. J. A. Sloane, May 29 2006
STATUS
approved