Easily solvable if you set that limit low and cheat. Just put a string representation of pi in the program, and chop it off at the requested length:
n = Input “num digits?”
if n between 0 and 8 inclusive
print left(“3.1415927”, n+1)
else
print “number out of supported range”
If you don’t cheat or if ”Keep a limit to how far the program will go” doesn’t mean what I read in it, I have my doubts anyone can write that program, even with support from Google.