A327788 a(n) is the smallest nonnegative integer m such that the integer part of tan(m) is equal to n.
0, 1, 20, 17, 105, 237, 303, 14, 58, 80, 124, 146, 11151, 168, 46318, 190, 46695, 212, 23997, 58432, 234, 13014, 38574, 61649, 82949, 256, 16586, 33271, 48891, 63091, 76581, 89361, 278, 8088, 18738, 28678, 37908, 46783, 54948, 63113, 70568, 77668, 84768, 91158, 97193, 300, 4915, 10240, 15565, 20535, 25150
Offset: 0
Examples
tan(0) = 0, so a(0) = 0. tan(1) = 1.557407724654902230506974807... so a(1) = 1. For m = 2, 3, 4, ... , 13, 15, 16, 18, 19, tan(m) < 2, tan (14) = 7.24460661609480..., tan(17) = 3.493915645474... and tan(20) = 2.2371609442247422652871732477... so a(2) = 20.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..5000
Crossrefs
Cf. A000503 (floor(tan(n))).
Programs
-
Magma
a:=[]; for n in [0..50] do m:=0; while Floor(Tan(m)) ne n do m:=m+1; end while; Append(~a,m); end for; a; // Marius A. Burtea, Oct 05 2019
-
Mathematica
Array[Block[{m = 0}, While[IntegerPart@ Tan@ m != #, m++]; m] &, 40, 0] (* Michael De Vlieger, Oct 05 2019 *)
-
PARI
a(n) = my(k=0); while (floor(tan(k)) != n, k++); k; \\ Michel Marcus, Oct 05 2019
-
Python
import numpy as np import math as m n = 1 i = 0 inp = np.zeros(1) out = inp while n < 10001: k=m.trunc(m.tan(i)) if k==n: inp = np.append(inp,int(n)) out = np.append(out,int(i)) print(n,i) n += 1 i = 0 continue else: i+=1