# Showing $f(x) = \sum_{q \le x} p(q)^3$ is well-defined and continuous on irrationals

Consider the function $f(x) = \sum_{q \le x} p(q)^3$ on $\mathbb{R}_{\ge 0}$ where $p(q)$ denotes the popcorn function and $q$ denotes a rational.

Question 1: Assuming $x > 0$, how do we know that $f$ returns a positive number and not $\infty$?

Question 2: How do we know $x$ is discontinuous on irrational numbers?

I've shown already that $f$ is strictly increasing and discontinuous on the rationals, in case those facts are of use.

• You mean continuous in Q2. Apr 30, 2014 at 13:28

Let us show that $f(x)$ is finite. For each $n\in\mathbb N$ there are at most $nx+1$ fractions $q\in[0,x]$ with denominator $n$, hence their contibution to the sum is $\le \frac{nx+1}{n^3}=\frac x{n^2}+\frac1{n^3}$ so that convergence follows by comparision with the convergent series $\sum\frac 1{n^2}$. More generally, we conclude for $u<v$ not only that $$\tag1 f(v)-f(u)\le (v-u)\sum_{n=1}^\infty \frac1{n^2}+\sum_{n=1}^\infty\frac1{n^3}$$ but if we additionally know that all fractions in $[u,v]$ have denominators $\ge N$ we get the stronger estimate $$\tag2 f(v)-f(u)\le (v-u)\sum_{n=N}^\infty \frac1{n^2}+\sum_{n=N}^\infty\frac1{n^3}.$$
The function $f$ is discontinuous at rational numbers, because there it "jumps" by $\frac1{p(x)^3}$.
Let $\alpha$ be irrational. Let $\epsilon>0$. Pick $N\in \mathbb N$ such that $\sum_{n=N}^\infty \frac1{n^2}+\sum_{n=N}^\infty\frac1{n^3}<\epsilon$. Let $u=\max\{\frac {\lfloor k\alpha\rfloor}k\,\mid 1\le k\le N\,\}$, $v=\min\{\frac {\lceil k\alpha\rceil}k\,\mid 1\le k\le N\,\}$. Then $u<\alpha<v$ and all rationals in $[u,v]$ have denomninator $\ge N$. As $v-u\le 1$, we see from $(2)$ that $f(v)-f(u)<\epsilon$. Since $f$ is incrreasing, we fave $|f(x)-f(\alpha)|<\epsilon$ for all $x\in(u,v)$, i.e. $f$ is continuous at $\alpha$.