Even with chars the inevitable happens because base keep increasing so the I/O char lengths you are processing, for each num are increasing (Ignoring the fact that num is increasing each loop so eventually the number of number being processed will exceed the UNO/Mega's memory)
The first seq starts 1,2,3
Later sequences start 1013,1014 and so are ~3 times as long for any given num
After enough loops the base sequence will get to numbers like 30010, 30011, 30011, ~5times as long and when base wraps around to -ves it will be longer.
However the String version does use more memory (and much more the way you have written it) and does seem to be doing some strange things with memory allocation.
So still a very good example.