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

What is mean of "any three consecutive digits"?
Posted by stat958 30 Jul 2013 12:52
" 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 !
Re: What is mean of "any three consecutive digits"?
Posted by mjolner 11 Aug 2013 12:09
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