Does $\lfloor \tan (n)\rfloor =n$ have infinite roots? Background
This post can be understood as the gap between $\tan n$ and $n$ has no upper limit.
Does the sequence $n+\tan(n), n \in\mathbb{N}$ have a lower bound?
I want to know how close $\tan n$ can be to $n$.
I try to find some solution with difference less than 1.
$$|\tan n -n|<1$$
or similar
$$\lfloor \tan (n)\rfloor =n$$
$\lfloor x\rfloor$ means floor function.
I did a quick search for $n<10^7$ and found no solution other than $n = 0,1$
Question
Is there an infinite number of integers n that make the equation true, and how big will the next solution be?
 A: Not an answer, but a heuristic, assuming $n\bmod 2\pi$ is a random number from $[0,2\pi).$
If $n>0$ is a solution, then we have a solution if:
$$\arctan(n-1)<n-\pi\left\lfloor \frac n{\pi}\right\rfloor<\arctan(n+1)$$
When $n\bmod \pi\leq\arctan(n),$ $-n$ is the solution.
So if $n\bmod {\pi}$ is treated as a random variable, the probability that you have a solution in $\pm n$ is $$\frac{\arctan(n+1)-\arctan(n-1)}{\pi}.$$
This means the expected number of solutions $\pm n$ for $n>1$ would be: $$\sum_{n=2}^{N}\frac{\arctan(n+1)-\arctan(n-1)}{\pi}=\frac{\arctan(N+1)+\arctan(N)-(\arctan 1+\arctan 2)}{\pi}\to\frac{\pi-\arctan 1-\arctan 2}{\pi}\approx 0.4.$$
So heuristically, it is not surprising that there might be zero solutions.
This can be made probabilistic. If $X$ is a uniform random variable in $[0,2\pi)$ then the expected number of integers $n\neq 0,1,-1$ such that $n>0$ such that $\lfloor\tan(X+n)\rfloor=n$ is $$\frac{\pi-\arctan(1)-\arctan(2)}{\pi}$$
Allowing $n=\pm1$ you’d get an expected count of $\frac3{4}.$ Adding $n=0$ we get an expected count of exactly $1.$

That $1$ is not actually surprising - it follows from a general rule.
Given an interval $[a,b]$ and disjoint measurable subsets $\{A_n\}_{n\in \mathbb Z}$ of $[a,b],$ uniform random variables $\{X_n\}_{n\in\mathbb Z},$ not necessarily independent, then the expected number of $X_n\in A_n$ is $$\mu(\bigcup_{n\in\mathbb Z} A_n),$$ where $\mu$ is the probability measure on $[a,b].$
In the initial problem, we can take $[-\pi/2,\pi/2)$ and $X_0$ to be a uniform random variable, and $X_n=(X_0+n)\bmod{\pi}.$ We take $A_n=[\arctan(n),\arctan(n+1)].$ Then $\bigcup A_n=(-\pi/2,\pi/2)$ so the expected number of $X_n\in A_n$ is $1.$

Technically, the general resul for this is false. But if $C_N$ is the number of $|n|\leq N$ such that $X_n\in A_n,$ then $$E(C_N)=\sum_{n=-N}^{N}\mu(A_n).$$
But in the specific case where $X_n=X_0+n\bmod2\pi,$ the measure of the values $x_0$ which given infinitely many $X_n\in A_n$ has zero measure, so then we can define $E(C_{\infty}).$
But the set of $x_0$ with at least one $x_0+n\bmod\pi$ with $|n|>N$ has measure at most $p_N=\mu(B_{N}),$ where $B_N=\bigcup_{|n|>N}A_n.$ But $\mu(B_N)\to0.$
So $\bigcap_{N=1}^{\infty} B_N$ has measure $0$ and is the set of problematic $x_0.$
A: According to https://oeis.org/A249836 (6th comment), $n = 0, 1$ are the only currently known solutions. You can also refer to https://oeis.org/A258024.
A: 
I want to know how close $\tan n$ can be to $n$.

Well, it's exactly equal if $n = 0$, but that's a boring answer.
Otherwise, here are the smallest values of $|\tan n - n|$ that I've found for $|n| \le 10^7$, using simple brute force:

*

*$n = \pm 1$, error ≈ 0.557408.  As noted, $n = +1$ is the only known nonzero solution to $\lfloor \tan n \rfloor = n$.

*$n = \pm 4$, error ≈ 2.842179

*$n = \pm 3$, error ≈ 3.142547

*$n = \pm 2$, error ≈ 4.185040

*$n = \pm 7$, error ≈ 6.128552

*$n = \pm 6$, error ≈ 6.291006

*$n = \pm 14$, error ≈ 6.755393

*$n = \pm 5$, error ≈ 8.380515

*$n = \pm 10$, error ≈ 9.351639

