login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = sign(tan(n)).
4

%I #14 Mar 24 2021 23:46:46

%S 0,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,

%T -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,

%U 1,-1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,-1,1,-1

%N a(n) = sign(tan(n)).

%C Also sign(cot(n)) for n > 0.

%C Also sign(sin(2n)) = A070747(2n).

%F a(n) = +1 if 0 < {n/Pi} < 1/2, -1 if 1/2 < {n/Pi} < 1, where {} is the fractional part.

%t a[n_] := Sign[Tan[n]]

%o (PARI) a(n) = sign(tan(n))

%Y Cf. A057427 (sign), A070747 (sign(sin(n)) or sign(csc(n))), A330034 (sign(cos(n)) or sign(sec(n))), A327422 (indices of +1), A327423 (indices of -1).

%K sign

%O 0

%A _Jianing Song_, Nov 27 2019