Write a program which takes an input (which may or may not be prime), and lists the immediate prime following and preceding it.
Example input:
1259
Example output:
1249 1277
Shortest program wins. Must execute within 10 seconds on a modern desktop PC. Inputs will be limited to 10,000 maximum.
n
for primality by creating a stringn
characters long and testing that against a regex absolutely awful? \$\endgroup\$