Grab the 1 megabyte of text for pi.
Writing a script, all 1, 2, 3, and 4 digit sequences exist within this file. Only the following 5 digit sequences don't exist within the first 1M digits of pi:
!!! 14523 not found
!!! 17125 not found
!!! 22801 not found
!!! 33394 not found
!!! 36173 not found
!!! 39648 not found
!!! 40527 not found
!!! 96710 not found
Rather than scanning the text file each time, index the location of all '#', '##', '###', '####' strings.
If you want all 5 or longer digits to be found in the string, include a larger version of the digits of pi.
Calculating the first N million digits of pi on an ipad is a waste of cpu and battery when the data file isn't that large.