forked from hackerearthclub/CODE2RACE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TANIYA GUPTA
authored
Oct 14, 2018
1 parent
e31cea8
commit 8fba434
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
The number,197 , is called a circular prime because all rotations of the digits: 197,971 and 719 are themselves prime. | ||
|
||
There are thirteen such primes below 100: 2,3,5,7,11,13,17,31,37,71,73,79 and 97. Sum of which is 446. | ||
|
||
Find the sum of circular primes that are below N? | ||
|
||
<b> Rotations can exceed N </b> | ||
|
||
#### Input Format | ||
|
||
Input contains an integer <b>N</b>. | ||
|
||
#### Output Format | ||
|
||
Print the required answer. | ||
|
||
#### CONSTRAINTS | ||
10≤ N ≤ 10^6 | ||
|
||
#### Sample Input | ||
``` | ||
100 | ||
``` | ||
|
||
#### Sample Output | ||
``` | ||
446 | ||
``` |