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

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

A082667 a(n) = floor(2n/3) * ceiling(2n/3) / 2.

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 10, 15, 18, 21, 28, 32, 36, 45, 50, 55, 66, 72, 78, 91, 98, 105, 120, 128, 136, 153, 162, 171, 190, 200, 210, 231, 242, 253, 276, 288, 300, 325, 338, 351, 378, 392, 406, 435, 450, 465, 496, 512, 528, 561, 578, 595, 630, 648, 666, 703, 722, 741
Offset: 1

Views

Author

Reinhard Zumkeller, May 18 2003

Keywords

Comments

Prefixing with 0,0,0 gives the sequence c(n) defined as the number of (x,y,z) satisfying 2w = 3x-3y where w,x,y are all in {1,...,n}, for n>=0; see the Formula section.
For n >= 2, numbers k such that floor(sqrt(2k)+1/2) | 2k. - Wesley Ivan Hurt, Dec 01 2020

Crossrefs

Cf. A008130, A151842 (first differences).

Programs

  • Mathematica
    n2[n_]:=Module[{c=2*n/3},(Floor[c]Ceiling[c])/2]; Array[n2,60] (* Harvey P. Dale, Feb 03 2012 *)
    LinearRecurrence[{1,0,2,-2,0,-1,1},{0,1,2,3,6,8,10},60] (* Robert G. Wilson v, Jun 06 2014 *)
  • PARI
    a(n) = (2*n\3) * ceil(2*n/3) / 2; \\ Amiram Eldar, May 10 2025

Formula

a(n) = a(n-1) + 2a(n-3) - 2a(n-4) - a(n-6) + a(n-7), (with 0,0,0 prefixed as in the Comments section). - Clark Kimberling, Apr 15 2012
a(n) = floor((n + 1)/3)*(n - floor((n + 1)/3)). - Wesley Ivan Hurt, Jun 06 2014
G.f.: -x^2*(1+x)*(1+x^2) / ( (1+x+x^2)^2*(x-1)^3 ). - R. J. Mathar, Jun 07 2014
From Amiram Eldar, May 10 2025: (Start)
Sum_{n>=2} 1/a(n) = 2 + Pi^2/12.
Sum_{n>=2} (-1)^n/a(n) = Pi - Pi^2/24 - 2. (End)
E.g.f.: exp(-x/2)*(2*exp(3*x/2)*(3*x^2 + 3*x - 1) - (3*x - 2)*cos(sqrt(3)*x/2) + sqrt(3)*x*sin(sqrt(3)*x/2))/27. - Stefano Spezia, May 11 2025
Showing 1-2 of 2 results.