Ed,
First off, will integers work for all the possible arguments? Food for thought.
Next, if you have an argument of 12,345,678, for example, how would you process it to get the correct 3-digit numbers? What would happen if you divided it by 1,000,000? And how would you get the rest of the number you want to work with once you've figured out what the "millions" 3-digit number is?
That should be a good start. Best of luck.