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-3 of 3 results.

A248434 Number of length three 0..n arrays with the sum of two elements equal to twice the third.

Original entry on oeis.org

2, 9, 16, 29, 42, 61, 80, 105, 130, 161, 192, 229, 266, 309, 352, 401, 450, 505, 560, 621, 682, 749, 816, 889, 962, 1041, 1120, 1205, 1290, 1381, 1472, 1569, 1666, 1769, 1872, 1981, 2090, 2205, 2320, 2441, 2562, 2689, 2816, 2949, 3082, 3221, 3360, 3505, 3650
Offset: 1

Views

Author

R. H. Hardin, Oct 06 2014

Keywords

Comments

Number of length three 0..n vectors that contain their arithmetic mean. - Hywel Normington, Aug 15 2020

Examples

			Some solutions for n=6:
..2....3....6....1....3....4....3....1....6....2....4....0....4....5....4....3
..6....1....2....0....2....3....3....2....5....3....0....1....3....6....4....5
..4....5....4....2....1....5....3....3....4....1....2....2....2....4....4....4
		

Crossrefs

Row 1 of A248433.
Cf. A168328, A319127, A319127. First differences A168301.

Programs

  • PARI
    a(n) = {my(res = 2); if(n % 2 == 0, res+=(1 + 6*floor(n/2))); n = (n-1)>>1; res+=6*n^2 + 8*n; res} \\ David A. Corneth, Aug 26 2020
    
  • PARI
    first(n) = {my(res = vector(n), inc = 7); res[1] = 2; for(i = 2, n, res[i] = res[i-1] + inc; inc += 6 * (i%2 == 1)); res} \\ David A. Corneth, Aug 26 2020

Formula

Empirical: a(n) = 2*a(n-1) -2*a(n-3) +a(n-4).
Empirical for n mod 2 = 0: a(n) = (3/2)*n^2 + n + 1.
Empirical for n mod 2 = 1: a(n) = (3/2)*n^2 + n - (1/2).
From Hywel Normington, Aug 21 2020: (Start)
a(n) = a(n-1) + 1 + 6*floor(n/2)
a(n) = A319127(n+1) + n + 1 = 6*floor((n+1)/2)*floor(n/2) + n + 1.
(End)
From Colin Barker, Aug 28 2020: (Start)
G.f.: x*(2 + 5*x - 2*x^2 + x^3) / ((1 - x)^3*(1 + x)).
a(n) = (1 + 3*(-1)^n + 4*n + 6*n^2) / 4 for n>0.
(End)

Extensions

Name simplified by Andrew Howroyd, Aug 14 2020

A168286 a(n) = (6*n + 3*(-1)^n + 1)/2.

Original entry on oeis.org

2, 8, 8, 14, 14, 20, 20, 26, 26, 32, 32, 38, 38, 44, 44, 50, 50, 56, 56, 62, 62, 68, 68, 74, 74, 80, 80, 86, 86, 92, 92, 98, 98, 104, 104, 110, 110, 116, 116, 122, 122, 128, 128, 134, 134, 140, 140, 146, 146, 152, 152, 158, 158, 164, 164, 170, 170, 176, 176, 182, 182
Offset: 1

Views

Author

Vincenzo Librandi, Nov 22 2009

Keywords

Crossrefs

Programs

  • Magma
    [n le 1 select n+1 else 6*n-Self(n-1)-2: n in [1..70]]; // Vincenzo Librandi, Sep 17 2013
  • Mathematica
    Table[3 n + 3 (-1)^n/2 + 1/2, {n, 70}] (* Bruno Berselli, Sep 17 2013 *)
    CoefficientList[Series[(2 + 6 x - 2 x^2)/((1 + x) (1 - x)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 17 2013 *)

Formula

a(n) = 6*n - a(n-1) - 2, with n>1, a(1)=2.
From Vincenzo Librandi, Sep 17 2013: (Start)
a(n) = a(n-1) +a(n-2) -a(n-3).
G.f.: 2*x*(1 + 3*x - x^2)/((1+x)*(1-x)^2).
a(n) = 2*A168233(n) = A168301(n) + 1. (End)
E.g.f.: (1/2)*(3 - 4*exp(x) + (6*x + 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 17 2016

Extensions

New definition by Bruno Berselli, Sep 17 2013

A168326 a(n) = (6*n - 3*(-1)^n - 1)/2.

Original entry on oeis.org

4, 4, 10, 10, 16, 16, 22, 22, 28, 28, 34, 34, 40, 40, 46, 46, 52, 52, 58, 58, 64, 64, 70, 70, 76, 76, 82, 82, 88, 88, 94, 94, 100, 100, 106, 106, 112, 112, 118, 118, 124, 124, 130, 130, 136, 136, 142, 142, 148, 148, 154, 154, 160, 160, 166, 166, 172, 172, 178, 178
Offset: 1

Views

Author

Vincenzo Librandi, Nov 23 2009

Keywords

Crossrefs

Programs

  • Magma
    [n eq 1 select n+3 else 6*n-Self(n-1)-4: n in [1..70]]; // Vincenzo Librandi, Sep 17 2013
  • Mathematica
    With[{c = 6 Range[0, 30] + 4}, Riffle[c, c]] (* or *) RecurrenceTable[ {a[1] == 4, a[n] == 6 n - a[n-1] - 4}, a, {n, 60}] (* Harvey P. Dale, Jun 12 2012 *)
    Table[3 n - 3 (-1)^n/2 - 1/2, {n, 70}] (* Bruno Berselli, Sep 17 2013 *)
    CoefficientList[Series[(4 + 2 x^2) / ((1 + x) (1 - x)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 17 2013 *)

Formula

a(n) = 6*n - a(n-1) - 4, with n>1, a(1)=4.
From Vincenzo Librandi, Sep 17 2013: (Start)
G.f.: 2*x*(2 + x^2)/((1+x)*(1-x)^2).
a(n) = 2*A168236(n) = A168300(n) - 1 = A168329(n) + 1 = A168301(n+1) - 3.
a(n) = a(n-1) +a(n-2) -a(n-3). (End)
E.g.f.: (1/2)*(-3 + 4*exp(x) + (6*x - 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 18 2016

Extensions

New definition by Bruno Berselli, Sep 17 2013
Showing 1-3 of 3 results.