Steve Witham's function reminded me that I have never learned the name of the following function, similar in some ways to Steve's example, but closely related to Farey sequences and continued fractions. Let f(0) = 0/1, and f(1) = 1/0. Forgive me for playing fast and loose with infinities; you'll see what I'm about in a moment. I'm going to give a recipe for calculating f at dyadic rationals; then I'm pretty sure f can be "completed" continuously to all reals between 0 and 1. f is going to be strictly increasing, and its range is all positive reals. Suppose we have a dyadic rational p/2^n in lowest terms (so p is odd). p/2^n is bracketed by simpler dyadic rationals, L = (p-1)/2^n and R = (p+1)/2^n, which when reduced to lowest terms will have denominators less than 2^n. Suppose we know f(L) = a/b, f(R) = c/d; then define f(p/2^n) = f((L+R)/2) = (a+c)/(b+d). This is the standard Farey mediant between f(L) and f(R). Note that 1/0 works perfectly well as a "bookend" for these mediants, which are guaranteed to be in lowest terms. Example: Find f(3/8). First we must find f(1/4) and f(1/2). f(1/2) is the mediant of 0/1 and 1/0, or 1/1. Now f(1/4) = 1/2, and f(3/8) = (1+1)/(2+1) = 2/3. Exercise: show that f(2/3) = (sqrt(5) + 1)/2. The function f stretches the dyadic rationals to cover all the rationals; it stretches the rationals to cover all the quadratic rationals. I have never seen a graph of it, but I'm sure it's fractally delicious.