login
A131372
Period 7: repeat [1, -1, 0, 1, 0, -1, 1].
3
1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, 0, -1, 1
OFFSET
0,1
FORMULA
From Wesley Ivan Hurt, Dec 23 2016: (Start)
G.f.: (1 - x + x^3 - x^5 + x^6)/(1 - x^7).
a(n) = a(n-7) for all n in Z.
a(n) = 1 - floor((1-n)/7) + floor((3-n)/7) - floor((5-n)/7) + floor((6-n)/7) + floor((7-n)/7) + floor((n-7)/7) + floor((n-6)/7) - floor((n-5)/7) + floor((n-3)/7) - floor((n-1)/7). (End)
G.f.: 1 / (1 + x / (1 - x / (1 + x / (1 - x / (1 - x^2 / (1 + x^4 / (1 + x^3))))))). - Michael Somos, Dec 26 2016
a(n) = (-1)^(mod(mod(n, 7), 3)>0) * A098457(n+1). - Michael Somos, Dec 26 2016
EXAMPLE
G.f. = 1 - x + x^3 - x^5 + x^6 + x^7 - x^8 + x^10 - x^12 + x^13 + x^14 + ...
MAPLE
A131372:=n->[1, -1, 0, 1, 0, -1, 1][(n mod 7)+1]: seq(A131372(n), n=0..100); # Wesley Ivan Hurt, Dec 23 2016
MATHEMATICA
PadRight[{}, 100, {1, -1, 0, 1, 0, -1, 1}] (* Wesley Ivan Hurt, Dec 23 2016 *)
PROG
(PARI) a(n)=[1, -1, 0, 1, 0, -1, 1][n%7+1] \\ Charles R Greathouse IV, Jul 13 2016
(Magma) &cat [[1, -1, 0, 1, 0, -1, 1]^^20]; // Wesley Ivan Hurt, Dec 23 2016
CROSSREFS
Sequence in context: A254651 A267579 A285414 * A098457 A284793 A260397
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Oct 01 2007
STATUS
approved