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=9.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{i=1..floor(n/9)} (9*i)!/(9*i-9)! + Sum_{j=1..8} (1-sign((n-j) mod 9)) * (Product_{i=1..j} n-i+1).
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 = 120;
a(6) = 1*2*3*4*5*6 = 720;
a(7) = 1*2*3*4*5*6*7 = 5040;
a(8) = 1*2*3*4*5*6*7*8 = 40320;
a(9) = 1*2*3*4*5*6*7*8*9 = 362880;
a(10) = 1*2*3*4*5*6*7*8*9 + 10 = 362890;
a(11) = 1*2*3*4*5*6*7*8*9 + 10*11 = 362990;
a(12) = 1*2*3*4*5*6*7*8*9 + 10*11*12 = 364200;
a(13) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13 = 380040;
a(14) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14 = 603120;
a(15) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14*15 = 3966480;
a(16) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14*15*16 = 58020480;
a(17) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14*15*16*17 = 980542080;
a(18) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14*15*16*17*18 = 17643588480;
a(19) = 1*2*3*4*5*6*7*8*9 + 10*11*12*13*14*15*16*17*18 + 19 = 17643588499; etc.
MATHEMATICA
a[n_]:=Sum[(9*i)!/(9*i-9)!, {i, 1, Floor[n/9] }] + Sum[(1-Sign[Mod[n-j, 9]])*Product[n-i+1, {i, 1, j}], {j, 1, 8}] ; Array[a, 27] (* Stefano Spezia, Apr 18 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Sep 13 2018
STATUS
approved