cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A319373 a(n) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11*12 + 13*14 - ... + (up to n).

Original entry on oeis.org

1, 2, -1, -10, -5, 20, 13, -36, -27, 54, 43, -78, -65, 104, 89, -136, -119, 170, 151, -210, -189, 252, 229, -300, -275, 350, 323, -406, -377, 464, 433, -528, -495, 594, 559, -666, -629, 740, 701, -820, -779, 902, 859, -990, -945, 1080, 1033, -1176, -1127
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 17 2018

Keywords

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=2.
An alternating version of A228958.

Examples

			a(1) = 1;
a(2) = 1*2 = 2;
a(3) = 1*2 - 3 = -1;
a(4) = 1*2 - 3*4 = -10;
a(5) = 1*2 - 3*4 + 5 = -5;
a(6) = 1*2 - 3*4 + 5*6 = 20;
a(7) = 1*2 - 3*4 + 5*6 - 7 = 13;
a(8) = 1*2 - 3*4 + 5*6 - 7*8 = -36;
a(9) = 1*2 - 3*4 + 5*6 - 7*8 + 9 = -27;
a(10) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 = 54;
a(11) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11 = 43;
a(12) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11*12 = -78;
a(13) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11*12 + 13 = -65;
a(14) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11*12 + 13*14 = 104;
a(15) = 1*2 - 3*4 + 5*6 - 7*8 + 9*10 - 11*12 + 13*14 - 15 = 89; etc.
		

Crossrefs

For similar sequences, see: A001057 (k=1), this sequence (k=2), A319543 (k=3), A319544 (k=4), A319545 (k=5), A319546 (k=6), A319547 (k=7), A319549 (k=8), A319550 (k=9), A319551 (k=10).

Programs

  • Mathematica
    Table[(Cos[n Pi/2] (1 - n - n^2) + Sin[n Pi/2] (1 + 3 n - n^2) - 1)/2, {n, 50}]
    a[n_] := (-1)^Floor[n/2] Sum[(1 - Sign[Mod[n - i, 2]]) Product[n - j + 1, {j, 1, i}], {i, 1, 1}] + Sum[(-1)^(Floor[i/2] + 1) (1 - Sign[Mod[i, 2]]) Product[i - j + 1, {j, 1, 2}], {i, 1, n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)
  • PARI
    Vec(x*(1 + x - 6*x^3 - x^4 + x^5) / ((1 - x)*(1 + x^2)^3) + O(x^50)) \\ Colin Barker, Sep 18 2018

Formula

a(n) = (cos(n*Pi/2)*(1-n-n^2) + sin(n*Pi/2)*(1+3*n-n^2) - 1)/2.
From Colin Barker, Sep 18 2018: (Start)
G.f.: x*(1 + x - 6*x^3 - x^4 + x^5) / ((1 - x)*(1 + x^2)^3).
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)
a(n) = (-1 + (-1)^((n-1)*n/2))/2 + (-2 + (-1)^n)*(-1)^(n*(n+1)/2)*n/2 - (-1)^((n-1)*n/2)*n^2/2. - Bruno Berselli, Sep 25 2018

A319545 a(n) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13*14*15 - ... + (up to n).

Original entry on oeis.org

1, 2, 6, 24, 120, 114, 78, -216, -2904, -30120, -30109, -29988, -28404, -6096, 330240, 330224, 329968, 325344, 237216, -1530240, -1530219, -1529778, -1519614, -1275216, 4845360, 4845334, 4844658, 4825704, 4275336, -12255360, -12255329, -12254368, -12222624
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=5.
An alternating version of A319206.

Examples

			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 = 114;
a(7) = 1*2*3*4*5 - 6*7 = 78;
a(8) = 1*2*3*4*5 - 6*7*8 = -216;
a(9) = 1*2*3*4*5 - 6*7*8*9 = -2904;
a(10) = 1*2*3*4*5 - 6*7*8*9*10 = -30120;
a(11) = 1*2*3*4*5 - 6*7*8*9*10 + 11 = -30109;
a(12) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12 = -29988;
a(13) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13 = -28404;
a(14) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13*14 = -6096;
a(15) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13*14*15 = 330240;
a(16) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13*14*15 - 16 = 330224;
a(17) = 1*2*3*4*5 - 6*7*8*9*10 + 11*12*13*14*15 - 16*17 = 329968; etc.
		

Crossrefs

For similar sequences, see: A001057 (k=1), A319373 (k=2), A319543 (k=3), A319544 (k=4), this sequence (k=5), A319546 (k=6), A319547 (k=7), A319549 (k=8), A319550 (k=9), A319551 (k=10).
Cf. A319206.

Programs

  • Mathematica
    a[n_]:=(-1)^Floor[n/5]*Sum[(1-Sign[Mod[n-i,5]])*Product[n-j+1,{j,1,i}],{i,1,4}]+Sum[(-1)^(Floor[i/5]+1)*(1-Sign[Mod[i,5]])*Product[i-j+1,{j,1,4}],{i,1,n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)
    Table[Total[Times@@@Partition[Riffle[Times@@@Partition[Range[n],UpTo[5]],{1,-1},{2,-1,2}],2]],{n,40}] (* Harvey P. Dale, Mar 30 2023 *)

Formula

a(n) = (-1)^floor(n/5) * Sum_{i=1..4} (1-sign((n-i) mod 5)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/5)+1) * (1-sign(i mod 5)) * (Product_{j=1..5} (i-j+1)).

A319550 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 - ... + (up to n).

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 362870, 362770, 361560, 345720, 122640, -3240720, -57294720, -979816320, -17642862720, -17642862701, -17642862340, -17642854740, -17642687160, -17638824840, -17545953600, -15220134720, 45348065280, 1683112193280
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=9.
An alternating version of A319211.

Examples

			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 = 362870;
a(11) = 1*2*3*4*5*6*7*8*9 - 10*11 = 362770;
a(12) = 1*2*3*4*5*6*7*8*9 - 10*11*12 = 361560;
a(13) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13 = 345720;
a(14) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14 = 122640;
a(15) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14*15 = -3240720;
a(16) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14*15*16 = -57294720;
a(17) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14*15*16*17 = -979816320;
a(18) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14*15*16*17*18 = -17642862720;
a(19) = 1*2*3*4*5*6*7*8*9 - 10*11*12*13*14*15*16*17*18 + 19 = -17642862701; etc.
		

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), this sequence (k=9), A319551 (k=10).
Cf. A319211.

Programs

  • Mathematica
    Table[Total[Times@@@Partition[Riffle[Times@@@Partition[Range[n],UpTo[9]],{1,-1},{1,-1,2}],2]],{n,30}] (* Harvey P. Dale, Oct 05 2024 *)

Formula

a(n) = (-1)^floor(n/9) * Sum_{i=1..8} (1-sign((n-i) mod 9)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/9)+1) * (1-sign(i mod 9)) * (Product_{j=1..9} (i-j+1)).

A319544 a(n) = 1*2*3*4 - 5*6*7*8 + 9*10*11*12 - 13*14*15*16 + ... - (up to n).

Original entry on oeis.org

1, 2, 6, 24, 19, -6, -186, -1656, -1647, -1566, -666, 10224, 10211, 10042, 7494, -33456, -33439, -33150, -27642, 82824, 82803, 82362, 72198, -172200, -172175, -171550, -154650, 319200, 319171, 318330, 292230, -543840, -543807, -542718, -504570, 869880
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=4.
An alternating version of A319205.

Examples

			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 = 19;
a(6) = 1*2*3*4 - 5*6 = -6;
a(7) = 1*2*3*4 - 5*6*7 = -186;
a(8) = 1*2*3*4 - 5*6*7*8 = -1656;
a(9) = 1*2*3*4 - 5*6*7*8 + 9 = -1647;
a(10) = 1*2*3*4 - 5*6*7*8 + 9*10 = -1566;
a(11) = 1*2*3*4 - 5*6*7*8 + 9*10*11 = -666;
a(12) = 1*2*3*4 - 5*6*7*8 + 9*10*11*12 = 10224;
a(13) = 1*2*3*4 - 5*6*7*8 + 9*10*11*12 - 13 = 10211;
a(14) = 1*2*3*4 - 5*6*7*8 + 9*10*11*12 - 13*14 = 10042;
a(15) = 1*2*3*4 - 5*6*7*8 + 9*10*11*12 - 13*14*15 = 7494; etc.
		

Crossrefs

For similar sequences, see: A001057 (k=1), A319373 (k=2), A319543 (k=3), this sequence (k=4), A319545 (k=5), A319546 (k=6), A319547 (k=7), A319549 (k=8), A319550 (k=9), A319551 (k=10).
Cf. A319205.

Programs

  • Mathematica
    a[n_]:=(-1)^Floor[n/4]*Sum[(1-Sign[Mod[n-i,4]])*Product[n-j+1,{j,1,i}],{i,1,3}]+Sum[(-1)^(Floor[i/4]+1)*(1-Sign[Mod[i,4]])*Product[i-j+1,{j,1,3}],{i,1,n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)

Formula

a(n) = (-1)^floor(n/4) * Sum_{i=1..3} (1-sign((n-i) mod 4)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/4)+1) * (1-sign(i mod 4)) * (Product_{j=1..4} (i-j+1)).

A319546 a(n) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13*14*15*16*17*18 - ... + (up to n).

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 713, 664, 216, -4320, -54720, -664560, -664547, -664378, -661830, -620880, 78000, 12701520, 12701501, 12701140, 12693540, 12525960, 8663640, -84207600, -84207575, -84206950, -84190050, -83716200, -69957000, 343310400, 343310369
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=6.
An alternating version of A319207.

Examples

			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 = 713;
a(8) = 1*2*3*4*5*6 - 7*8 = 664;
a(9) = 1*2*3*4*5*6 - 7*8*9 = 216;
a(10) = 1*2*3*4*5*6 - 7*8*9*10 = -4320;
a(11) = 1*2*3*4*5*6 - 7*8*9*10*11 = -54720;
a(12) = 1*2*3*4*5*6 - 7*8*9*10*11*12 = -664560;
a(13) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13 = -664547;
a(14) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13*14 = -664378;
a(15) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13*14*15 = -661830;
a(16) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13*14*15*16 = -620880;
a(17) = 1*2*3*4*5*6 - 7*8*9*10*11*12 + 13*14*15*16*17 = 78000; etc.
		

Crossrefs

For similar sequences, see: A001057 (k=1), A319373 (k=2), A319543 (k=3), A319544 (k=4), A319545 (k=5), this sequence (k=6), A319547 (k=7), A319549 (k=8), A319550 (k=9), A319551 (k=10).
Cf. A319207.

Programs

  • Mathematica
    a[n_]:=(-1)^Floor[n/6]*Sum[(1-Sign[Mod[n-i,6]])*Product[n-j+1,{j,1,i}],{i,1,5}]+Sum[(-1)^(Floor[i/6]+1)*(1-Sign[Mod[i,6]])*Product[i-j+1,{j,1,5}],{i,1,n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)

Formula

a(n) = (-1)^floor(n/6) * Sum_{i=1..5} (1-sign((n-i) mod 6)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/6)+1) * (1-sign(i mod 6)) * (Product_{j=1..6} (i-j+1)).

A319547 a(n) = 1*2*3*4*5*6*7 - 8*9*10*11*12*13*14 + 15*16*17*18*19*20*21 - ... + (up to n).

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 5040, 5032, 4968, 4320, -2880, -90000, -1230480, -17292240, -17292225, -17292000, -17288160, -17218800, -15896880, 10614960, 568758960, 568758938, 568758454, 568746816, 568455360, 560865360, 355631760, -5398802640, -5398802611
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=7.
An alternating version of A319208.

Examples

			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 = 5032;
a(9) = 1*2*3*4*5*6*7 - 8*9 = 4968;
a(10) = 1*2*3*4*5*6*7 - 8*9*10 = 4320;
a(11) = 1*2*3*4*5*6*7 - 8*9*10*11 = -2880;
a(12) = 1*2*3*4*5*6*7 - 8*9*10*11*12 = -90000;
a(13) = 1*2*3*4*5*6*7 - 8*9*10*11*12*13 = -1230480;
a(14) = 1*2*3*4*5*6*7 - 8*9*10*11*12*13*14 = -17292240;
a(15) = 1*2*3*4*5*6*7 - 8*9*10*11*12*13*14 + 15 = -17292225;
a(16) = 1*2*3*4*5*6*7 - 8*9*10*11*12*13*14 + 15*16 = -17292000; etc.
		

Crossrefs

For similar sequences, see: A001057 (k=1), A319373 (k=2), A319543 (k=3), A319544 (k=4), A319545 (k=5), A319546 (k=6), this sequence (k=7), A319549 (k=8), A319550 (k=9), A319551 (k=10).
Cf. A319208.

Programs

  • Mathematica
    a[n_]:=(-1)^Floor[n/7]*Sum[(1-Sign[Mod[n-i,7]])*Product[n-j+1,{j,1,i}],{i,1,6}]+Sum[(-1)^(Floor[i/7]+1)*(1-Sign[Mod[i,7]])*Product[i-j+1,{j,1,6}],{i,1,n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)

Formula

a(n) = (-1)^floor(n/7) * Sum_{i=1..6} (1-sign((n-i) mod 7)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/7)+1) * (1-sign(i mod 7)) * (Product_{j=1..7} (i-j+1)).

A319549 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 - ... + (up to n).

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 5040, 40320, 40311, 40230, 39330, 28440, -114120, -2121840, -32392080, -518878080, -518878063, -518877774, -518872266, -518761800, -516436200, -465156720, 716713200, 29135312640, 29135312615, 29135311990, 29135295090, 29134821240
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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=8.
An alternating version of A319209.

Examples

			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 = 40311;
a(10) = 1*2*3*4*5*6*7*8 - 9*10 = 40230;
a(11) = 1*2*3*4*5*6*7*8 - 9*10*11 = 39330;
a(12) = 1*2*3*4*5*6*7*8 - 9*10*11*12 = 28440;
a(13) = 1*2*3*4*5*6*7*8 - 9*10*11*12*13 = -114120;
a(14) = 1*2*3*4*5*6*7*8 - 9*10*11*12*13*14 = -2121840;
a(15) = 1*2*3*4*5*6*7*8 - 9*10*11*12*13*14*15 = -32392080;
a(16) = 1*2*3*4*5*6*7*8 - 9*10*11*12*13*14*15*16 = -518878080;
a(17) = 1*2*3*4*5*6*7*8 - 9*10*11*12*13*14*15*16 + 17 = -518878063; etc.
		

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), this sequence (k=8), A319550 (k=9), A319551 (k=10).
Cf. A319209.

Programs

  • Mathematica
    a[n_]:=(-1)^Floor[n/8]*Sum[(1-Sign[Mod[n-i,8]])*Product[n-j+1,{j,1,i}],{i,1,7}]+Sum[(-1)^(Floor[i/8]+1)*(1-Sign[Mod[i,8]])*Product[i-j+1,{j,1,7}],{i,1,n}]; Array[a, 30] (* Stefano Spezia, Sep 23 2018 *)
    Table[Total[Times@@@Partition[Riffle[Times@@@Partition[Range[n],UpTo[8]],{1,-1},{1,-1,2}],2]],{n,30}] (* Harvey P. Dale, Oct 05 2024 *)

Formula

a(n) = (-1)^floor(n/8) * Sum_{i=1..7} (1-sign((n-i) mod 8)) * (Product_{j=1..i} (n-j+1)) + Sum_{i=1..n} (-1)^(floor(i/8)+1) * (1-sign(i mod 8)) * (Product_{j=1..8} (i-j+1)).

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).

Original entry on oeis.org

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
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 22 2018

Keywords

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.

Examples

			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.
		

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.

Programs

  • 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 *)

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)).
Showing 1-8 of 8 results.