login
A319205
a(n) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15*16 + 17*18*19*20 + ... + (up to n).
10
1, 2, 6, 24, 29, 54, 234, 1704, 1713, 1794, 2694, 13584, 13597, 13766, 16314, 57264, 57281, 57570, 63078, 173544, 173565, 174006, 184170, 428568, 428593, 429218, 446118, 919968, 919997, 920838, 946938, 1783008, 1783041, 1784130, 1822278, 3196728, 3196765
OFFSET
1,2
COMMENTS
In general, for sequences that multiply the first k natural numbers, and then add the product of the next k natural numbers (preserving the order of operations up to n), we have a(n) = Sum_{i=1..floor(n/k)} (k*i)!/(k*i-k)! + Sum_{j=1..k-1} (1-sign((n-j) mod k)) * (Product_{i=1..j} n-i+1). Here, k=4.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,5,-5,0,0,-10,10,0,0,10,-10,0,0,-5,5,0,0,1,-1).
FORMULA
a(n) = Sum_{i=1..floor(n/4)} (4*i)!/(4*i-4)! + Sum_{j=1..3} (1-sign((n-j) mod 4)) * (Product_{i=1..j} n-i+1).
From Colin Barker, Sep 14 2018: (Start)
G.f.: x*(1 + x + 4*x^2 + 18*x^3 + 20*x^5 + 160*x^6 + 1380*x^7 - 6*x^8 - 34*x^9 + 40*x^10 + 3720*x^11 + 8*x^12 + 4*x^13 - 192*x^14 + 1020*x^15 - 3*x^16 + 9*x^17 - 12*x^18 + 6*x^19) / ((1 - x)^6*(1 + x)^5*(1 + x^2)^5).
a(n) = a(n-1) + 5*a(n-4) - 5*a(n-5) - 10*a(n-8) + 10*a(n-9) + 10*a(n-12) - 10*a(n-13) - 5*a(n-16) + 5*a(n-17) + a(n-20) - a(n-21) for n>21.
(End)
EXAMPLE
a(1) = 1;
a(2) = 1*2 = 2;
a(3) = 1*2*3 = 6;
a(4) = 1*2*3*4 = 24;
a(5) = 1*2*3*4 + 5 = 29;
a(6) = 1*2*3*4 + 5*6 = 54;
a(7) = 1*2*3*4 + 5*6*7 = 234;
a(8) = 1*2*3*4 + 5*6*7*8 = 1704;
a(9) = 1*2*3*4 + 5*6*7*8 + 9 = 1713;
a(10) = 1*2*3*4 + 5*6*7*8 + 9*10 = 1794;
a(11) = 1*2*3*4 + 5*6*7*8 + 9*10*11 = 2694;
a(12) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 = 13584;
a(13) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13 = 13597;
a(14) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14 = 13766;
a(15) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15 = 16314;
a(16) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15*16 = 57264;
a(17) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15*16 + 17 = 57281;
a(18) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15*16 + 17*18 = 57570;
a(19) = 1*2*3*4 + 5*6*7*8 + 9*10*11*12 + 13*14*15*16 + 17*18*19 = 63078;
etc.
MATHEMATICA
a[n_]:=Sum[(4*i)!/(4*i-4)!, {i, 1, Floor[n/4] }] + Sum[(1-Sign[Mod[n-j, 4]])*Product[n-i+1, {i, 1, j}], {j, 1, 3}] ; Array[a, 40] (* Stefano Spezia, Sep 17 2018 *)
PROG
(PARI) Vec(x*(1 + x + 4*x^2 + 18*x^3 + 20*x^5 + 160*x^6 + 1380*x^7 - 6*x^8 - 34*x^9 + 40*x^10 + 3720*x^11 + 8*x^12 + 4*x^13 - 192*x^14 + 1020*x^15 - 3*x^16 + 9*x^17 - 12*x^18 + 6*x^19) / ((1 - x)^6*(1 + x)^5*(1 + x^2)^5) + O(x^40)) \\ Colin Barker, Sep 14 2018
CROSSREFS
Cf. A093361, (k=1) A000217, (k=2) A228958, (k=3) A319014, (k=4) this sequence, (k=5) A319206, (k=6) A319207, (k=7) A319208, (k=8) A319209, (k=9) A319211, (k=10) A319212.
Sequence in context: A304039 A246454 A079433 * A110728 A359450 A190424
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Sep 13 2018
STATUS
approved