# Why is the factorial operation needed here?

Consider the following definition of the Dirichlet function which is $$1$$ at all rational points of the real line and vanishes otherwise:

$$\lim_{j\to\infty}\lim_{k\to\infty} (\cos(k!\pi x))^{2j}.$$

I want to understand why $$k!$$ is used here instead of just $$k,$$ which appears to work just as fine, as explained below.

For rational $$x=p/q,$$ say, as $$k\to\infty$$ eventually $$kx$$ (and therefore $$k!x$$) becomes integral, so that $$\cos(kπx)=\pm 1.$$ Thus, the limit as $$j\to\infty$$ is trivially $$1$$ because of the square. If $$x$$ is irrational, we must have $$|\cos(kπx)|<1,$$ so that for any $$k,$$ we must then have, as $$j \to \infty, |\cos(kπx)|\to 0.$$

I have not used the operation $$!$$ applied to the $$k$$ at all in this alternative definition, which appears to do just as well. Why then is it included in the definition; what am I missing?

• "eventually $kx$ becomes integral" This is wrong. Take $x=1/2$ for instance - it will be non-integral for all odd $k$. – Wojowu Apr 17 at 18:38
• If you were actually doing this on a computer i.e. approximately, the convergence with $k!$ is way faster – George Dewhirst Apr 17 at 18:39
• @Wojowu Oh, I'm ashamed. Thanks. – Allawonder Apr 17 at 18:39
• @GeorgeDewhirst Of course. I had only been wondering why one couldn't just use $k,$ purely as a valid definition, without other considerations -- like computational efficiency, as you mention. – Allawonder Apr 17 at 18:41