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.

A186731 a(3n) = 2n, a(3n+1) = n, a(3n+2) = n+1.

Original entry on oeis.org

0, 0, 1, 2, 1, 2, 4, 2, 3, 6, 3, 4, 8, 4, 5, 10, 5, 6, 12, 6, 7, 14, 7, 8, 16, 8, 9, 18, 9, 10, 20, 10, 11, 22, 11, 12, 24, 12, 13, 26, 13, 14, 28, 14, 15, 30, 15, 16, 32, 16, 17, 34, 17, 18, 36, 18, 19, 38, 19, 20, 40, 20, 21, 42, 21, 22, 44, 22, 23, 46, 23, 24, 48
Offset: 0

Views

Author

Philippe Deléham, Jan 21 2012

Keywords

Crossrefs

Column k = 2 of triangle in A198295.

Programs

  • Magma
    I:=[0,0,1,2,1,2]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..80]]; // Vincenzo Librandi, Apr 28 2015
    
  • Maple
    f:= gfun:-rectoproc({a(n)=2*a(n-3)-a(n-6), seq(a(i) = [0,0,1,2,1,2][i+1],i=0..5)},a(n),remember):
    map(f, [$0..100]); # Robert Israel, Apr 01 2016
  • Mathematica
    CoefficientList[Series[(x*(1 + x)/(1 - x^3))^2, {x, 0, 100}], x] (* Wesley Ivan Hurt, Apr 28 2015 *)
    LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 0, 1, 2, 1, 2}, 100] (* Vincenzo Librandi, Apr 28 2015 *)
  • PARI
    vector(50,n,n--;(n+1+n*0^(n%3)-(n+1)%3)/3) \\ Derek Orr, Apr 28 2015

Formula

G.f.: (x*(1+x)/(1-x^3))^2.
a(n) = |A099254(n-2)| = |A099470(n-1)|. - R. J. Mathar, May 02 2013
From Wesley Ivan Hurt, Apr 28 2015: (Start)
a(n) = 2*a(n-3)-a(n-6).
a(n) = (n+1+n*0^mod(n,3)-mod(n+1,3))/3. (End)
E.g.f.: (4/9)*x*exp(x) - (x/9)*exp(-x/2)*cos(sqrt(3)*x/2) - (sqrt(3)/9)*(2+x)*exp(-x/2)*sin(sqrt(3)*x/2). - Robert Israel, Apr 01 2016
From Ridouane Oudra, Nov 24 2024: (Start)
a(n) = n^3/6 - n/6 - (n^2 + 3*n/2 - 5/2)*floor(n/3) + (3*n/2 + 9/2)*floor(n/3)^2.
a(n) = t(n+1)*t(n+3) - t(n-1)*t(n+1), where t(n) = A002264(n).
a(n) = A008130(n+1) - A008130(n-1). (End)
Sum_{n>=2} (-1)^n/a(n) = 3*log(2)/2. - Amiram Eldar, May 10 2025

Extensions

More terms from Vincenzo Librandi, Apr 28 2015