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!)
A257145 a(n) = 5 * floor( (n+2) / 5) - n with a(0) = 1. 4
1, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0, -1, -2, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Cycle period is 5, {0, -1, -2, 2, 1} after the first five terms. - Robert G. Wilson v, Aug 02 2018
LINKS
FORMULA
Euler transform of length 5 sequence [-1, -2, 0, 0, 1].
a(5*n) = 0 for all n in Z except n=0.
a(n) = -a(-n) for all n in Z except n=0.
a(n) = a(n+5) for all n in Z except n=-5 or n=0.
Convolution inverse is A257143.
G.f.: (1 - x) * (1 - x^2)^2 / (1 - x^5).
G.f.: (1 - 2*x^2 + x^4) / (1 + x + x^2 + x^3 + x^4).
a(n) = -A117444(n), n>0. - R. J. Mathar, Oct 05 2017
EXAMPLE
G.f. = 1 - x - 2*x^2 + 2*x^3 + x^4 - x^6 - 2*x^7 + 2*x^8 + x^9 - x^11 + ...
MATHEMATICA
a[ n_] := If[ n==0, 1, -Mod[ n, 5, -2]];
a[ n_] := If[ n==0, 1, Sign[n] SeriesCoefficient[ (1 - x) * (1 - x^2)^2 / (1 - x^5), {x, 0, Abs@n}]];
CoefficientList[Series[(1-x)*(1-x^2)^2/(1-x^5), {x, 0, 60}], x] (* G. C. Greubel, Aug 02 2018 *)
a[n_] := 5 Floor[(n + 2)/5] - n; Array[a, 77, 0] (* or *)
CoefficientList[ Series[(x - 1)^2 (x + 1)^2/(x^4 + x^3 + x^2 + x + 1), {x, 0, 76}], x] (* or *)
LinearRecurrence[{-1, -1, -1, -1}, {1, -1, -2, 2, 1, 0}, 76] (* Robert G. Wilson v, Aug 02 2018*)
PROG
(PARI) {a(n) = if( n==0, 1, (n+2) \ 5 * 5 - n)};
(PARI) {a(n) = if( n==0, 1, [0, -1, -2, 2, 1][n%5 + 1])};
(PARI) {a(n) = if( n==0, 1, sign(n) * polcoeff( (1 - x) * (1 - x^2)^2 / (1 - x^5) + x * O(x^abs(n)), abs(n)))};
(PARI) x='x+O('x^60); Vec((1-x)*(1-x^2)^2/(1-x^5)) \\ G. C. Greubel, Aug 02 2018
(Haskell)
a257145 0 = 1
a257145 n = div (n + 2) 5 * 5 - n -- Reinhard Zumkeller, Apr 17 2015
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x)*(1-x^2)^2/(1-x^5))); // G. C. Greubel, Aug 02 2018
CROSSREFS
Sequence in context: A092339 A079693 A117444 * A253262 A015504 A055892
KEYWORD
sign,easy
AUTHOR
Michael Somos, Apr 16 2015
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 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)