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!)
A267831 Expansion of (1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2). 1
1, 6, -3, -16, 1, 22, -3, -32, 1, 38, -3, -48, 1, 54, -3, -64, 1, 70, -3, -80, 1, 86, -3, -96, 1, 102, -3, -112, 1, 118, -3, -128, 1, 134, -3, -144, 1, 150, -3, -160, 1, 166, -3, -176, 1, 182, -3, -192, 1, 198, -3, -208, 1, 214, -3, -224, 1, 230, -3, -240, 1, 246, -3, -256, 1, 262, -3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
G.f.: (1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2).
a(n) = Sum_{k = 0..n} (-1)^(1/2 - sin((2*k + 1)*Pi/4)/sqrt(2))*(4*k + 1).
a(n) = -8*floor((n - 3)/4)^2 - 21*floor((n - 3)/4) - 8*floor((n - 2)/4)^2 + 8*floor((n - 1)/4)^2 + 8*floor(n/4)^2 - 17*floor((n - 2)/4) + 13*floor((n - 1)/4) + 9*floor(n/4) - 16.
a(n) = -1 + (2 + (1 + 4*n)*(1 - (-1)^n)/2)*(-1)^((n-1)*n/2). Therefore: a(4*k) = 1, a(4*k+1) = 2*(8*k+3), a(4*k+2) = -3, a(4*k+3) = -16*(k+1). [Bruno Berselli, Jan 21 2016]
EXAMPLE
a(0) = (0 + 1) = 1;
a(1) = (0 + 1) + (2 + 3) = 6;
a(2) = (0 + 1) + (2 + 3) - (4 + 5) = -3;
a(3) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) = -16;
a(4) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) + (8 + 9) = 1;
a(5) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) + (8 + 9) + (10 + 11) = 22, etc.
MATHEMATICA
Table[Sum[(-1)^(1/2 - Sin[(2 k + 1) (Pi/4)]/Sqrt[2]) (4 k + 1), {k, 0, n}], {n, 0, 70}]
Table[-8 Floor[(n - 3)/4]^2 - 21 Floor[(n - 3)/4] - 8 Floor[(n - 2)/4]^2 + 8 Floor[(n - 1)/4]^2 + 8 Floor[n/4]^2 - 17 Floor[(n - 2)/4] + 13 Floor[(n - 1)/4] + 9 Floor[n/4] - 16, {n, 0, 70}]
Table[-1 + (2 + (1 + 4 n) (1 - (-1)^n)/2) (-1)^((n - 1) n/2), {n, 0, 70}] (* Bruno Berselli, Jan 21 2016 *)
LinearRecurrence[{1, -2, 2, -1, 1}, {1, 6, -3, -16, 1}, 70] (* Vincenzo Librandi, Jan 21 2016 *)
PROG
(Sage) [-1+(2+(1+4*n)*(1-(-1)^n)/2)*(-1)^((n-1)*n/2) for n in (0..70)]; # Bruno Berselli, Jan 21 2016
(Magma) &cat [[1, 2*(8*n+3), -3, -16*(n+1)]: n in [0..17]]; // Bruno Berselli, Jan 21 2016
(Magma) I:=[1, 6, -3, -16, 1]; [n le 5 select I[n] else Self(n-1)-2*Self(n-2)+2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..70]]; // Vincenzo Librandi, Jan 21 2016
(PARI) Vec((1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2) + O(x^70)) \\ Michel Marcus, Oct 29 2017
CROSSREFS
Sequence in context: A046879 A248267 A236415 * A328011 A231881 A229005
KEYWORD
sign,easy
AUTHOR
Ilya Gutkovskiy, Jan 21 2016
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 24 09:18 EDT 2024. Contains 371935 sequences. (Running on oeis4.)