OFFSET
0,4
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..800
FORMULA
For n>=2, a(2n)=floor(e*n!)-1, a(2*n+1)=(n+1)*(floor(e*n!)-1). - Benoit Cloitre, Apr 28 2003
MATHEMATICA
Module[{a = 0}, Join[{a}, Flatten[Array[{a *= #, a += #} &, 20]]]] (* Paolo Xausa, Oct 24 2024 *)
PROG
(PARI) a(n)=if(n<2, 0, if(n%2, (n+1)/2*(floor(exp(1)*((n-1)/2)!)-1), floor(exp(1)*(n/2)!)-1))
(PARI) A082458(n, a=0)={for(i=2, n+1, if(bittest(i, 0), a+=i\2, a*=i\2)); a} \\ M. F. Hasler, Feb 25 2018
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Vladeta Jovovic, Apr 25 2003
EXTENSIONS
Edited by M. F. Hasler, Feb 25 2018
STATUS
approved