%I #32 Dec 07 2019 12:18:24
%S 1,2,5,12,9,30,13,56,17,90,21,132,25,182,29,240,33,306,37,380,41,462,
%T 45,552,49,650,53,756,57,870,61,992,65,1122,69,1260,73,1406,77,1560,
%U 81,1722,85,1892,89,2070,93,2256,97,2450,101,2652,105,2862,109,3080,113
%N For even n, a(n)=2n+1, for odd n, a(n)=n(n+1)
%C First the sum then the product of two successive integers.
%H G. C. Greubel, <a href="/A103832/b103832.txt">Table of n, a(n) for n = 0..5000</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-3,0,1).
%F G.f.: (1+3x^2)(1+2x-x^2)/((1-x)^3*(1+x)^3). [_R. J. Mathar_, Aug 30 2008]
%F a(n) = (n^2+3*n+1-(n^2-n-1)*(-1)^n)/2. - _Luce ETIENNE_, Apr 13 2016
%F E.g.f.: (2*x+1)*cosh(x) + (x^2 + 2*x)*sinh(x). - _Ilya Gutkovskiy_, Apr 13 2016
%F a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6). - _G. C. Greubel_, Apr 13 2016
%e a(4)=4+5=9, a(5)=5*6=30.
%p seq(2*n+1+(n mod 2)*(n^2-n-1), n=0..100); # _Robert Israel_, Apr 14 2016
%t Flatten[Table[{i + i + 1, (i + 1)(i + 2)}, {i, 0, 98, 2}]]
%t LinearRecurrence[{0,3,0,-3,0,1},{1,2,5,12,9,30},60] (* _Harvey P. Dale_, Oct 07 2016 *)
%o (Python)
%o for n in range(0,10**3):
%o print((int)((n**2+3*n+1-(n**2-n-1)*(-1)**n)/2))
%o # _Soumil Mandal_, Apr 14 2016
%Y Cf. A103831.
%K nonn
%O 0,2
%A _Zak Seidov_, Feb 17 2005, Feb 18 2005
%E Edited by _N. J. A. Sloane_, Aug 29 2008 at the suggestion of _R. J. Mathar_
%E Corrected typo in the definition - _R. J. Mathar_, Sep 07 2010