# Hard limit: $\lim_{n \to +\infty} \left(\sin\left(2\pi(k!)x\right)\right)^n$

I've stumbled on a particularly hard limit problem:

Evaluate the following limit: $$\lim_{n \to +\infty} \left(\sin\left(2\pi(k!)x\right)\right)^n\text{, with n, k \in \mathbb{N} and x \in \mathbb{R}}$$ You will find a sequence $a_k(x)$. Then evaluate the limit $$\lim_{k \to +\infty} a_k(x)$$ finding a function $f(x)$.

Side question: does something change if the $2$ inside the sine is dropped?

Now, I've already seen something similar to this, but instead of the sine function it had the cosine. That is the Dirichlet function, giving $1$ for the rationals and $0$ otherwise.
The problem is that here we have a sine, which is $0$ at multiples of $2\pi$. So my intuition is that the limit is $0$, but that does not make sense with respect to the problem statement!

Notice that this sine do not depend on $n$, so the limit is undefined when sine is equal to $-1$ which means that $k!x\ne\frac34+\lambda$ for all $\lambda\in\mathbb{N}$.
Now, consider the cases when limit is defined. If sine is $1$ limit is $1$, otherwise it is $0$. It means that for $k!x=\frac14+\lambda$ limit is $1$. So, we can define sequence $a_k(x)$ as $$a_k(x)=\begin{cases}1,&k!x=\frac14+\lambda\\0,&\text{otherwise}\end{cases}$$ Consider the limit $$\lim_{k\to\infty}a_k(x)$$ We already know that it is equal to $0$ or $1$ (we assumed that it is defined), so we just need to find when this limit is equal to $1$. It happens when $$k!x\equiv\frac14\pmod1$$ Because of $k!$ divided by any integer is still integer, we can conclude that if $x$ can be written as $$x=\frac1{4\omega}$$ for some $\omega\in\mathbb{N}$ then limit is undefined, because then it is both defined and undefined which is impossible. So, final answer will be $$\lim_{k\to\infty}a_k(x)=0,x\ne\frac{1}{4\omega}$$ As an answer to your side question, if we drop $2$ from the limit, the final limit will be defined for $$x\ne\frac{1}{2\omega}$$ and for these values it converges to $0$.
Difference between your limit and dirichlet function is because your limit in exponent has $n$ instead of $2n$. Because of that your function is undefined for some values of $k$ and $x$, but dirichlet functions is defined for all real numbers. Dirichlet function is defined as $$f(x)=\lim_{k\to\infty}\left(\lim_{n\to\infty}\cos^{2n}\left(\pi k!x\right)\right)$$ where $n,k\in\mathbb{N},x\in\mathbb{R}$. It is equal to $1$ if cosine is $1$ and it is equal to $0$ otherwise. Now, consider the cases when cosine is $1$. It happens when $k!x$ is an integer. Because $k!$ divided by any integer still remains integer (it includes all rational numbers because dividing by rational number $\frac pq$ where $p,q\in\mathbb{N}$ is dividing by $p$ and multiplying by $q$) we can conclude that is $k!x$ is integer for all rational $x$. Otherwise $k!x$ is not integer and also not rational. This proves that dirichlet functions is $1$ at rational numbers and $0$ at irrational numbers.
$|sin(f(x))| ≤ 1,$ so $lim_{n->∞} sin^n(f(x))$ is equal to 0 for all points where the un-exponentiated function is unequal to ±1. Even at those points, those that were originally 1 will stay equal to 1, but those that were equal to -1 will bounce back and forth between 1 and -1 as the exponent changes between even to odd numbers.