ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1586. Threeprime Numbers

" Pasha calls an integer a threeprime number if any three consecutive digits of this integer form a three-digit prime number"?
For example,if a number a1a2a3a4, a1a2a3 is a prime number ,the number a2a3a4 must be a prime number??  yes or no, please help me!  thank you !
yes.

In general:
For an n-digit number = a(1)a(2)a(3)a(4)...a(n-1)a(n)
define p(i) = 3-digit number a(i)a(i+1)a(i+2) where 1 <= i <= n-2.
Then each p(i) has to be a prime number *AND* for each p(i) holds: 100 <= p(i) <= 999

Edited by author 11.08.2013 12:11