working self describing numbers soln in rb