login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A319493
a(n) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10*11 - 12 + 13*14 - ... + (up to n).
1
1, 2, -1, 3, 19, 13, 20, 69, 60, 70, 170, 158, 171, 340, 325, 341, 597, 579, 598, 959, 938, 960, 1444, 1420, 1445, 2070, 2043, 2071, 2855, 2825, 2856, 3817, 3784, 3818, 4974, 4938, 4975, 6344, 6305, 6345, 7945, 7903, 7946, 9795, 9750, 9796, 11912, 11864
OFFSET
1,2
FORMULA
a(n) = floor((n + 1)/3)*(3*floor((n + 1)/3)^2 - 1) + n*(floor((n - 1)/3) - floor((n - 2)/3)) - 3*floor(n/3)*(floor(n/3) + 1)/2.
From Colin Barker, Sep 20 2018: (Start)
G.f.: x*(1 + x)*(1 - 3*x^2 + 4*x^3 + 9*x^4 - 6*x^5 + 4*x^6) / ((1 - x)^4*(1 + x + x^2)^3).
a(n) = a(n-1) + 3*a(n-3) - 3*a(n-4) - 3*a(n-6) + 3*a(n-7) + a(n-9) - a(n-10) for n>10.
(End)
EXAMPLE
a(1) = 1;
a(2) = 1*2 = 2;
a(3) = 1*2 - 3 = -1;
a(4) = 1*2 - 3 + 4 = 3;
a(5) = 1*2 - 3 + 4*5 = 19;
a(6) = 1*2 - 3 + 4*5 - 6 = 13;
a(7) = 1*2 - 3 + 4*5 - 6 + 7 = 20;
a(8) = 1*2 - 3 + 4*5 - 6 + 7*8 = 69;
a(9) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 = 60;
a(10) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10 = 70;
a(11) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10*11 = 170;
a(12) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10*11 - 12 = 158;
a(13) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10*11 - 12 + 13 = 171;
a(14) = 1*2 - 3 + 4*5 - 6 + 7*8 - 9 + 10*11 - 12 + 13*14 = 340; etc.
MATHEMATICA
Table[Floor[(n + 1)/3]*(3*Floor[(n + 1)/3]^2 - 1) + n*(Floor[(n - 1)/3] - Floor[(n - 2)/3]) - 3*Floor[n/3]*(Floor[n/3] + 1)/2, {n, 50}]
From Stefano Spezia, Sep 23 2018: (Start)
CoefficientList[Series[(1 + x)*(1 - 3*x^2 + 4*x^3 + 9*x^4 - 6*x^5 + 4*x^6)/((1 - x)^4*(1 + x + x^2)^3), {x, 0, 50}], x]
(End)
PROG
(PARI) Vec(x*(1 + x)*(1 - 3*x^2 + 4*x^3 + 9*x^4 - 6*x^5 + 4*x^6) / ((1 - x)^4*(1 + x + x^2)^3) + O(x^50)) \\ Colin Barker, Sep 20 2018
CROSSREFS
Sequence in context: A247482 A156364 A106169 * A372659 A340202 A108353
KEYWORD
sign,easy
AUTHOR
Wesley Ivan Hurt, Sep 20 2018
STATUS
approved