Reduced-denominator function unbounded on every interval (source code)

= Reduced-denominator function unbounded on every interval
{title2=$f(p/q)=q,\quad f(x)=0\ (x\notin\mathbb Q)$}

On $[0,1]$, use reduced representations of <rational numbers> with positive denominator. This reverses the nonzero values of the <Thomae function>, while leaving its values at <irrational numbers> zero. Every interval of positive length contains <rational numbers> of arbitrarily large reduced denominator: there are only finitely many fractions in $[0,1]$ with denominator at most a fixed $M$, whereas any open interval contains infinitely many <rational numbers>. Thus this <function> taking finite <real number> values is unbounded on every nondegenerate subinterval.