It seems to me like the trick would be to find a way to generate, in order, the numbers you can't print, then you just print the gaps between them.
It seems to me like the trick would be to find a way to generate, in order, the numbers you can't print, then you just print the gaps between them.