A181995 a(n) = if n mod 2 = 1 then n*(n - 1) else (n - 1)^2 + (n - 2)/2.
0, 0, 1, 6, 10, 20, 27, 42, 52, 72, 85, 110, 126, 156, 175, 210, 232, 272, 297, 342, 370, 420, 451, 506, 540, 600, 637, 702, 742, 812, 855, 930, 976, 1056, 1105, 1190, 1242, 1332, 1387, 1482, 1540, 1640, 1701, 1806, 1870, 1980, 2047, 2162, 2232, 2352, 2425, 2550, 2626, 2756, 2835, 2970, 3052, 3192, 3277, 3422, 3510, 3660, 3751, 3906, 4000, 4160, 4257, 4422
Offset: 0
Links
- H. L. Abbott, D. Hanson, N. Sauer, Intersection theorems for systems of sets, J. Combinatorial Theory Ser. A 12 (1972), 381--389.MR0297579 (45 #6633).
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
Magma
[n*(4*n - 5 - (-1)^n)/4 : n in [0..80]]; // Wesley Ivan Hurt, Apr 11 2016
-
Maple
f:=n->if n mod 2 = 1 then n*(n-1) else (n-1)^2+(n-2)/2; fi; [seq(f(n),n=0..130)];
-
Mathematica
Table[n*(4*n - 5 - (-1)^n)/4, {n, 0, 80}] (* Wesley Ivan Hurt, Apr 11 2016 *)
-
PARI
a(n)=n*(4*n-5-(-1)^n)/4 \\ Charles R Greathouse IV, Oct 07 2015
Formula
G.f.: -x^2*(1 + 5*x + 2*x^2)/((1 + x)^2*(x - 1)^3). - R. J. Mathar, Apr 06 2012
a(n) = n*(4*n - 5 - (-1)^n)/4. - Luce ETIENNE, Oct 04 2014
From Wesley Ivan Hurt, Apr 11 2016: (Start)
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = Sum_{i=floor((n-1)/2)..floor(3*(n-1)/2)} i. (End)
E.g.f.: x^2*cosh(x) - x*(1 - 2*x)*sinh(x)/2. - Franck Maminirina Ramaharo, Nov 08 2018
Comments