login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A195062 Period 7: repeat [1, 0, 1, 0, 1, 0, 1]. 1
1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1

COMMENTS

First differs from A115788 at a(113).

LINKS

Table of n, a(n) for n=1..126.

Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,1).

FORMULA

From Hieronymus Fischer, Apr 30 2012: (Start)

a(n) = (1+(-1)^((n-1) mod 7))/2.

a(n) = 1-((n-1) mod 7) mod 2.

G.f.: x*(1-x^8)/((1-x^2)*(1-x^7)).

Also: x*(1+x^2)*(1+x^4)/(1-x^7). (End)

From Wesley Ivan Hurt, Jul 11 2016: (Start)

a(n) = a(n-7) for n>7.

a(n) = 1 - Sum_{k=1..6} floor((n + k - 1)/7)*(-1)^k. (End)

MAPLE

a:= n-> [1, 0, 1, 0, 1, 0, 1][1+irem(n+6, 7)]:

seq(a(n), n=1..150); # Alois P. Heinz, Jan 22 2012

MATHEMATICA

PadRight[{}, 130, {1, 0, 1, 0, 1, 0, 1}] (* Harvey P. Dale, Feb 14 2015 *)

Table[Boole@ Or[OddQ@ #, # == 0] &@ Mod[n, 7], {n, 120}] (* or *)

Rest@ CoefficientList[Series[x (1 - x^8)/((1 - x^2) (1 - x^7)), {x, 0, 120}], x] (* or *)

Table[1 - Sum[Floor[(n + k - 1)/7] (-1)^k, {k, 6} ], {n, 120}] (* Michael De Vlieger, Jul 13 2016 *)

PROG

&cat [[1, 0, 1, 0, 1, 0, 1]^^20]; // Wesley Ivan Hurt, Jul 11 2016

(PARI) a(n)=1-(n-1)%7%2 \\ Charles R Greathouse IV, Jul 13 2016

CROSSREFS

Cf. A115788.

Sequence in context: A276793 A284364 A115788 * A229940 A179761 A102863

Adjacent sequences:  A195059 A195060 A195061 * A195063 A195064 A195065

KEYWORD

nonn,easy

AUTHOR

Omar E. Pol, Jan 22 2012

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 22 22:19 EDT 2021. Contains 343197 sequences. (Running on oeis4.)