login
For even n, a(n) = n*(n+1), for odd n, a(n) = 2*n + 1.
2

%I #39 Sep 08 2022 08:45:17

%S 0,3,6,7,20,11,42,15,72,19,110,23,156,27,210,31,272,35,342,39,420,43,

%T 506,47,600,51,702,55,812,59,930,63,1056,67,1190,71,1332,75,1482,79,

%U 1640,83,1806,87,1980,91,2162,95,2352,99,2550,103,2756,107,2970,111,3192,115

%N For even n, a(n) = n*(n+1), for odd n, a(n) = 2*n + 1.

%C First the product then the sum of two successive integers.

%H G. C. Greubel, <a href="/A103831/b103831.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.: (6*x^5+3*x^4-18*x^3-10*x^2+20*x+7) / (1-x)^3*(1+x)^3.

%F a(n) = (n^2+3*n+1+(n^2-n-1)*(-1)^n)/2. - _Luce ETIENNE_, Apr 13 2016

%F E.g.f.: (x^2 + 2*x)*cosh(x) + (2*x + 1)*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=20, a(5)=5+6=11.

%t Flatten[Table[{i + i + 1, (i + 1)(i + 2)}, {i, 1, 99, 2}]]

%o (Python)

%o for n in range(0,10**3):

%o print((n**2+3*n+1+(n**2-n-1)*(-1)**n)/2)

%o # _Soumil Mandal_, Apr 14 2016

%o (Magma) [IsOdd(n) select (2*n+1) else n*(n+1): n in [0..52]]; // _Vincenzo Librandi_, Apr 14 2016

%Y Cf. A103832.

%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_