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.

A079524 Expansion of (x + b*x^2 - b*x^3)/((1 - x^2)*(1 - x)^2) with b=2.

Original entry on oeis.org

0, 1, 4, 6, 10, 13, 18, 22, 28, 33, 40, 46, 54, 61, 70, 78, 88, 97, 108, 118, 130, 141, 154, 166, 180, 193, 208, 222, 238, 253, 270, 286, 304, 321, 340, 358, 378, 397, 418, 438, 460, 481, 504, 526, 550, 573, 598, 622, 648, 673, 700, 726, 754, 781, 810, 838
Offset: 0

Views

Author

Carlos Alves, Jan 21 2003

Keywords

Examples

			G.f. = x + 4*x^2 + 6*x^3 + 10*x^4 + 13*x^5 + 18*x^6 + 22*x^7 + 28*x^8 + 33*x^9 + ...
Here b=2; a(0)=a(1)=1. a(2)= a(0)+2 (mod a(1)+2) = 3 (mod 3) =0 a(3)= a(1)+3 (mod a(2)+3) = 4 (mod 3) =1 a(4)= a(2)+4 (mod a(3)+4) = 4 (mod 5) =4 etc... we get 6, 13, 18, ...
		

Crossrefs

Cf. A024206 and A078126.

Programs

  • GAP
    a:=[0,1,4,6];; for n in [5..50] do a[n]:=2*a[n-1]-2*a[n-3]+a[n-4]; od; a; # G. C. Greubel, Jan 15 2019
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!( (x+2*x^2-2*x^3)/((1-x)^2*(1- x^2)) )); // G. C. Greubel, Jan 15 2019
    
  • Maple
    a:= n-> (Matrix([[4,1,0,-2]]). Matrix(4, (i,j)-> if (i=j-1) then 1 elif j=1 then [2,0,-2,1][i] else 0 fi)^n)[1,4]: seq(a(n), n=1..60); # Alois P. Heinz, Aug 06 2008
  • Mathematica
    b = 2; aa = {1, 1}; Do[AppendTo[aa, Mod[ aa[[ -2]] + n, aa[[ -1]] + n]], {n, b, 50}]; Drop[aa, 2]
    CoefficientList[Series[(x+2*x^2-2*x^3)/((1-x)^2*(1-x^2)),{x,0,60}],x]
    LinearRecurrence[{2,0,-2,1},{0,1,4,6},50] (* Harvey P. Dale, Apr 20 2015 *)
  • PARI
    my(x='x+O('x^50)); concat([0], Vec( (x+2*x^2-2*x^3)/((1-x)^2*(1- x^2)) )) \\ G. C. Greubel, Jan 15 2019
    
  • Sage
    ((x+2*x^2-2*x^3)/((1-x)^2*(1- x^2))).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jan 15 2019
    

Formula

G.f.: (x + 2*x^2 - 2*x^3) / ((1 - x)^2 * (1 - x^2)).
a(n) = a(n-2)+n (mod a(n-1)+n) with n>=2 and initial values (1, 1).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4), a(0)=0, a(1)=1, a(2)=4, a(3)=6. - Harvey P. Dale, Apr 20 2015
a(n) = (2*n*(n+6)-3*(1-(-1)^n))/8. - Luce ETIENNE, Jun 05 2015