login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A079524 Expansion of (x + b*x^2 - b*x^3)/((1 - x^2)*(1 - x)^2) with b=2. 4
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
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
EXAMPLE
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, ...
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 *)
PROG
(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
(Magma) m:=50; R<x>:=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
(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
(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
CROSSREFS
Cf. A024206 and A078126.
Sequence in context: A186514 A184402 A350567 * A141740 A088135 A302660
KEYWORD
easy,nonn
AUTHOR
Carlos Alves, Jan 21 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 14:51 EDT 2024. Contains 371749 sequences. (Running on oeis4.)