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!)
A330034 a(n) = sign(cos(n)). 1
1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
Also sign(sec(n)).
LINKS
FORMULA
a(n) = -1 if 1/4 < {n/(2*Pi)} < 3/4, +1 if n = 0 or 0 < {n/(2*Pi)} < 1/4 or 3/4 < {n/(2*Pi)} < 1, where {} is the fractional part.
MATHEMATICA
a[n_] := Sign[Cos[n]]; Array[a, 100, 0]
PROG
(PARI) a(n) = sign(cos(n))
CROSSREFS
Cf. A057427 (sign), A070747 (sign(sin(n)) or sign(csc(n))), A330035 (sign(tan(n)) or sign(cot(n))), A131503 (indices of +1), A246444 (indices of -1).
Sequence in context: A156734 A119664 A257075 * A010555 A108784 A127252
KEYWORD
sign,easy
AUTHOR
Jianing Song, Nov 27 2019
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 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)