This is a question I came up with in high school, but has not yet found a decent proof.
Let $f(n)=0$ if $n$ is even, and $f(n)=1$ if $n$ is odd.
Let the decimal representation of $\sqrt2$ be
Prove that $a$ is irrational.
I have tried to use the idea that all rational numbers have a finite or recurring decimal representation, but that doesn't seem to help much.
I also believe this is just a special case of a more general problem as the form of $f(n)$ can be more complicated and the base need not be $10$.
Thank you in advance for any help.