A138019 Period 5: repeat [1, 1, 0, -1, -1].
1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1, -1, 1, 1, 0, -1
Offset: 0
Examples
G.f. = 1 + x - x^3 - x^4 + x^5 + x^6 - x^8 - x^9 + x^10 + x^11 - x^13 + ...
Links
- Index entries for linear recurrences with constant coefficients, signature (-1, -1, -1, -1).
Programs
-
Maple
A138019 := proc(n) op( 1+modp(n,5),[1,1,0,-1,-1]) ; end proc: seq(A138019(n),n=0..30) ; # R. J. Mathar, Feb 12 2021
-
Mathematica
a[ n_] := Sign[2 - Mod[n, 5]]; (* Michael Somos, Jun 17 2015 *) PadRight[{},120,{1,1,0,-1,-1}] (* Harvey P. Dale, Oct 06 2023 *)
-
PARI
a(n)=sign(2-n%5) /* Jaume Oliver Lafont, Aug 28 2009 */
Formula
Inverse binomial transform of A138003.
O.g.f.: (1+x)(x^2+x+1)/(1+x+x^2+x^3+x^4). - R. J. Mathar, Jun 28 2008
Euler transform of length 5 sequence [ 1, -1, -1, 0, 1]. - Michael Somos, Jun 17 2015
G.f.: (1 - x^2 ) * (1 - x^3) / ((1 - x) * (1 - x^5)). - Michael Somos, Jun 17 2015
a(n) = -a(-1-n) = a(n+5) for all n in Z. - Michael Somos, Jun 17 2015