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.

A319866 a(n) = 2*1 + 4*3 + 6*5 + 8*7 + 10*9 + 12*11 + ... + (up to the n-th term).

Original entry on oeis.org

2, 2, 6, 14, 20, 44, 52, 100, 110, 190, 202, 322, 336, 504, 520, 744, 762, 1050, 1070, 1430, 1452, 1892, 1916, 2444, 2470, 3094, 3122, 3850, 3880, 4720, 4752, 5712, 5746, 6834, 6870, 8094, 8132, 9500, 9540, 11060, 11102, 12782, 12826, 14674, 14720, 16744
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 29 2018

Keywords

Comments

For similar multiply/add sequences in descending blocks of k natural numbers, we have: a(n) = Sum_{j=1..k-1} (floor((n-j)/k)-floor((n-j-1)/k)) * (Product_{i=1..j} n-i-j+k+1) + Sum_{j=1..n} (floor(j/k)-floor((j-1)/k)) * (Product_{i=1..k} j-i+1). Here, k=2.
The denominators of the generating functions for these sequences are (1 + x)*(1 - x^k)^(k+1). - Georg Fischer and Andrew Howroyd, Mar 07 2020

Examples

			a(1) = 2;
a(2) = 2*1 = 2;
a(3) = 2*1 + 4 = 6;
a(4) = 2*1 + 4*3 = 14;
a(5) = 2*1 + 4*3 + 6 = 20;
a(6) = 2*1 + 4*3 + 6*5 = 44;
a(7) = 2*1 + 4*3 + 6*5 + 8 = 52;
a(8) = 2*1 + 4*3 + 6*5 + 8*7 = 100;
a(9) = 2*1 + 4*3 + 6*5 + 8*7 + 10 = 110;
a(10) = 2*1 + 4*3 + 6*5 + 8*7 + 10*9 = 190;
a(11) = 2*1 + 4*3 + 6*5 + 8*7 + 10*9 + 12 = 202;
etc.
		

Crossrefs

For similar sequences, see: A000217 (k=1), this sequence (k=2), A319867 (k=3), A319868 (k=4), A319869 (k=5), A319870 (k=6), A319871 (k=7), A319872 (k=8), A319873 (k=9), A319874 (k=10).

Programs

  • Maple
    a:=(n,k)->add((floor((n-j)/k)-floor((n-j-1)/k))*(mul(n-i-j+k+1,i=1..j)),j=1..k-1) + add((floor(j/k)-floor((j-1)/k))*(mul(j-i+1,i=1..k)),j=1..n): seq(a(n,2),n=1..50); # Muniru A Asiru, Sep 30 2018
  • Mathematica
    k:=2; a[n_]:= Sum[(Floor[(n-j)/k]-Floor[(n-j-1)/k])* Product[n-i-j+k+1, {i,1,j }] , {j,1,k-1} ]  + Sum[(Floor[j/k]-Floor[(j-1)/k])* Product[j-i+1, {i,1,k} ], {j,1,n}]; Array[a, 50] (* Stefano Spezia, Sep 30 2018 *)
    CoefficientList[Series[2/((-1 + x)^2 (1 + x)^2) + ( 2 (x + 3 x^3))/((-1 + x)^4 (1 + x)^3), {x, 0, 50}], x] (* Stefano Spezia, Sep 30 2018 *)
    LinearRecurrence[{1,3,-3,-3,3,1,-1},{2,2,6,14,20,44,52},60] (* Harvey P. Dale, Mar 01 2025 *)
  • PARI
    Vec(2*x*(1 - x^2 + 4*x^3) / ((1 - x)^4*(1 + x)^3) + O(x^50)) \\ Colin Barker, Sep 30 2018

Formula

G.f.: 2*x/((-1 + x)^2*(1 + x)^2) + 2*(x^2 + 3*x^4)/((-1 + x)^4 (1 + x)^3). - Stefano Spezia, Sep 30 2018
From Colin Barker, Sep 30 2018: (Start)
a(n) = (4*n - 6*n + 3*n^2 + 2*n^3) / 12 for n even.
a(n) = (15 + 4*n + 6*n - 3*n^2 + 2*n^3) / 12 for n odd.
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)