The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A319551 a(n) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15*16*17*18*19*20 + 21*22*23*24*25*26*27*28*29*30 - ... + (up to n). 8
1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 3628789, 3628668, 3627084, 3604776, 3268440, -2136960, -94389120, -1760693760, -33518499840, -670438944000, -670438943979, -670438943538, -670438933374, -670438688976, -670432568400, -670273178400 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
In general, for alternating sequences that multiply the first k natural numbers, and subtract/add the products of the next k natural numbers (preserving the order of operations up to n), we have a(n) = (-1)^floor(n/k) * Sum_{i=1..k-1} (1-sign((n-i) mod k)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/k)+1) * (1-sign(i mod k)) * (Product_{j=1..k} (i-j+1)). Here k=10.
An alternating version of A319212.
LINKS
FORMULA
a(n) = (-1)^floor(n/10) * Sum_{i=1..9} (1-sign((n-i) mod 10)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/10)+1) * (1-sign(i mod 10)) * (Product_{j=1..10} (i-j+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 = 3628800;
a(11) = 1*2*3*4*5*6*7*8*9*10 - 11 = 3628789;
a(12) = 1*2*3*4*5*6*7*8*9*10 - 11*12 = 3628668;
a(13) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13 = 3627084;
a(14) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14 = 3604776;
a(15) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15 = 3268440;
a(16) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15*16 = -2136960;
a(17) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15*16*17 = -94389120;
a(18) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15*16*17*18 = -1760693760;
a(19) = 1*2*3*4*5*6*7*8*9*10 - 11*12*13*14*15*16*17*18*19 = -33518499840; etc.
MATHEMATICA
a[n_]:=(-1)^Floor[n/10]*Sum[(1-Sign[Mod[n-i, 10]])*Product[n-j+1, {j, 1, i}], {i, 1, 9}]+Sum[(-1)^(Floor[i/10]+1)*(1-Sign[Mod[i, 10]])*Product[i-j+1, {j, 1, 10}], {i, 1, n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)
CROSSREFS
For similar sequences, see: A001057 (k=1), A319373 (k=2), A319543 (k=3), A319544 (k=4), A319545 (k=5), A319546 (k=6), A319547 (k=7), A319549 (k=8), A319550 (k=9), this sequence (k=10).
Cf. A319212.
Sequence in context: A360462 A072133 A230232 * A232985 A319212 A276844
KEYWORD
sign,easy
AUTHOR
Wesley Ivan Hurt, Sep 22 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 1 15:30 EDT 2024. Contains 373025 sequences. (Running on oeis4.)