OFFSET
0,3
COMMENTS
The first term a(0) would be a fraction if the floor( ... ) function were omitted; for n >= 2, all terms from A003422 are even. - M. F. Hasler, Dec 16 2007
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
FORMULA
a(0)=0, a(1)=1, a(2)=2, a(n) = (n+1)*a(n-1) - n*a(n-2). - Benoit Cloitre, Sep 07 2002
a(0) = 0, a(n) = (1/2)*floor(1 + 1*floor(1 + 2*floor(1 + ... + (n-1)*floor(1+n*floor(1))). - Joseph E. Cooper III (easonrevant(AT)gmail.com), Aug 19 2008
G.f.: G(0)/(1-x)/2 -1/2, where G(k)= 1 + (2*k + 1)*x/( 1 - 2*x*(k+1)/(2*x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
G.f.: A(x) = (Sum_{n>=0} x^n*n!)/(2-2*x) - 1/2 = G(0)/(4*(1-x)) - 1/2, where G(k) = 1 + 1/(1 - x/(x + 1/(k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 02 2013
a(n) ~ n!/2. - Vaclav Kotesovec, Aug 10 2013
E.g.f.: -1/2 + (exp(x)/2)*Sum_{k>=0} (k! - k*Gamma(k,x)). - Robert Israel, Jun 01 2015
a(n) = ((n+1)!*ExpIntegral(n+2,-1)+Ei(1)+Pi*i)/(2*e). - Ammar Khatab, Aug 14 2020
MAPLE
a:= proc(n) a(n):= `if`(n<3, n, (n+1)*a(n-1)-n*a(n-2)) end:
seq(a(n), n=0..25); # Alois P. Heinz, Feb 01 2013
MATHEMATICA
f[x_] := {Floor[1 + (n - x[[2]])*x[[1]]], x[[2]] + 1};
a[0] = 0; a[n_] := Nest[f, {1, 0}, n][[1]]/2 (* Joseph E. Cooper III (easonrevant(AT)gmail.com), Aug 19 2008 *) (* updated by Jean-François Alcover, Jun 01 2015 *)
a[n_]:=-(1/2) Subfactorial[-1]-1/2(-1)^n Gamma[2+n] Subfactorial[-2-n]; Table[a[n] //FullSimplify, {n, 0, 25}] (* Gerry Martens, May 29 2015 *)
PROG
(PARI) A014288(n)=sum(k=0, n, k!)>>1 \\ M. F. Hasler, Dec 16 2007
(Magma) [Floor((&+[Factorial(j): j in [0..n]])/2): n in [0..30]]; // G. C. Greubel, Sep 05 2022
(SageMath) [sum(factorial(j) for j in (0..n))//2 for n in (0..30)] # G. C. Greubel, Sep 05 2022
(Python)
from math import factorial
def A014288(n): return sum(factorial(k) for k in range(n+1))>>1 # Chai Wah Wu, Nov 01 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by M. F. Hasler, Dec 16 2007
STATUS
approved