OFFSET
1,1
COMMENTS
For similar multiply/add sequences in descending blocks of k natural numbers, we have: a(n) = Sum_{j=1..k-1} (floor((n-j)/k)-floor((n-j-1)/k)) * (Product_{i=1..j} n-i-j+k+1) + Sum_{j=1..n} (floor(j/k)-floor((j-1)/k)) * (Product_{i=1..k} j-i+1). Here, k=2.
The denominators of the generating functions for these sequences are (1 + x)*(1 - x^k)^(k+1). - Georg Fischer and Andrew Howroyd, Mar 07 2020
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
G.f.: 2*x/((-1 + x)^2*(1 + x)^2) + 2*(x^2 + 3*x^4)/((-1 + x)^4 (1 + x)^3). - Stefano Spezia, Sep 30 2018
From Colin Barker, Sep 30 2018: (Start)
a(n) = (4*n - 6*n + 3*n^2 + 2*n^3) / 12 for n even.
a(n) = (15 + 4*n + 6*n - 3*n^2 + 2*n^3) / 12 for n odd.
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) - 3*a(n-4) + 3*a(n-5) + a(n-6) - a(n-7) for n>7.
(End)
EXAMPLE
a(1) = 2;
a(2) = 2*1 = 2;
a(3) = 2*1 + 4 = 6;
a(4) = 2*1 + 4*3 = 14;
a(5) = 2*1 + 4*3 + 6 = 20;
a(6) = 2*1 + 4*3 + 6*5 = 44;
a(7) = 2*1 + 4*3 + 6*5 + 8 = 52;
a(8) = 2*1 + 4*3 + 6*5 + 8*7 = 100;
a(9) = 2*1 + 4*3 + 6*5 + 8*7 + 10 = 110;
a(10) = 2*1 + 4*3 + 6*5 + 8*7 + 10*9 = 190;
a(11) = 2*1 + 4*3 + 6*5 + 8*7 + 10*9 + 12 = 202;
etc.
MAPLE
a:=(n, k)->add((floor((n-j)/k)-floor((n-j-1)/k))*(mul(n-i-j+k+1, i=1..j)), j=1..k-1) + add((floor(j/k)-floor((j-1)/k))*(mul(j-i+1, i=1..k)), j=1..n): seq(a(n, 2), n=1..50); # Muniru A Asiru, Sep 30 2018
MATHEMATICA
k:=2; a[n_]:= Sum[(Floor[(n-j)/k]-Floor[(n-j-1)/k])* Product[n-i-j+k+1, {i, 1, j }] , {j, 1, k-1} ] + Sum[(Floor[j/k]-Floor[(j-1)/k])* Product[j-i+1, {i, 1, k} ], {j, 1, n}]; Array[a, 50] (* Stefano Spezia, Sep 30 2018 *)
CoefficientList[Series[2/((-1 + x)^2 (1 + x)^2) + ( 2 (x + 3 x^3))/((-1 + x)^4 (1 + x)^3), {x, 0, 50}], x] (* Stefano Spezia, Sep 30 2018 *)
PROG
(PARI) Vec(2*x*(1 - x^2 + 4*x^3) / ((1 - x)^4*(1 + x)^3) + O(x^50)) \\ Colin Barker, Sep 30 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Sep 29 2018
STATUS
approved