OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..875
FORMULA
Conjecture: 2*a(n) -5*a(n-1) -(n+2)*a(n-2) +2*(n+6)*a(n-3) +(n-13)*a(n-4) -4*(n-3)*a(n-5) +2*(n-3)*a(n-6) = 0. - R. J. Mathar, Nov 10 2013
MATHEMATICA
A[n_, k_]:= A[n, k]= If[n==1, 1, If[k==1, n, If[2<=k<n+1, (1-k)*k!*Binomial[n, k] + Sum[j*j!*Binomial[n, j], {j, k}], Sum[j*j!*Binomial[n, j], {j, n}]]]];
a[n_]:= a[n]= Sum[A[k, n-k+1], {k, n}];
Table[a[n], {n, 30}] (* G. C. Greubel, Dec 29 2021 *)
PROG
(Sage)
@CachedFunction
def A(n, k):
if (n==1): return 1
elif (k==1): return n
elif (2 <= k < n+1): return factorial(k)*binomial(n, k) + sum( j*factorial(j)*binomial(n, j) for j in (1..k-1) )
else: return sum( j*factorial(j)*binomial(n, j) for j in (1..n) )
@CachedFunction
def a(n): return sum( A(k, n-k+1) for k in (1..n) )
[a(n) for n in (1..30)] # G. C. Greubel, Dec 29 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Apr 20 2004
STATUS
approved