If you can find it, "The Dot and the Line" is another brilliant tale along these (ahem) lines [0]
I've had a look around and cannot find it online, though the excellent animated adaptation is easy to find [1] - well worth picking up the hardcopy as a beautifully designed picture book.
I'd also recommend Norton Juster's other work "The Phantom Tollboth" as being another great math & science inspired kids fairy-tale type book [2]
[0] https://en.wikipedia.org/wiki/The_Dot_and_the_Line