Tests for UglyNumbers
Optimizing by avoiding substr()
Optimizing by caching ugly results