OFFSET
0,2
COMMENTS
First the sum then the product of two successive integers.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
G.f.: (1+3x^2)(1+2x-x^2)/((1-x)^3*(1+x)^3). [R. J. Mathar, Aug 30 2008]
a(n) = (n^2+3*n+1-(n^2-n-1)*(-1)^n)/2. - Luce ETIENNE, Apr 13 2016
E.g.f.: (2*x+1)*cosh(x) + (x^2 + 2*x)*sinh(x). - Ilya Gutkovskiy, Apr 13 2016
a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6). - G. C. Greubel, Apr 13 2016
EXAMPLE
a(4)=4+5=9, a(5)=5*6=30.
MAPLE
seq(2*n+1+(n mod 2)*(n^2-n-1), n=0..100); # Robert Israel, Apr 14 2016
MATHEMATICA
Flatten[Table[{i + i + 1, (i + 1)(i + 2)}, {i, 0, 98, 2}]]
LinearRecurrence[{0, 3, 0, -3, 0, 1}, {1, 2, 5, 12, 9, 30}, 60] (* Harvey P. Dale, Oct 07 2016 *)
PROG
(Python)
for n in range(0, 10**3):
print((int)((n**2+3*n+1-(n**2-n-1)*(-1)**n)/2))
# Soumil Mandal, Apr 14 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 17 2005, Feb 18 2005
EXTENSIONS
Edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar
Corrected typo in the definition - R. J. Mathar, Sep 07 2010
STATUS
approved