0 like 0 dislike
484 views

Problem

A prime number (or a prime) is a natural number greater than 1 that can only be divided by 1 and itself.
Ex-First few Prime number are- 
2, 3, 5, 7, 11, 13, 17, 19,...
A digit prime is a prime number whose sum of digits is also prime. 
For example the prime number 23 is a digit prime because 2+3=5 and 5 is a prime number. 17 is not a digit prime because 1+7 = 8, and 8 is not a prime number. Write a program to find out the number of digit primes within a certain range less than 1000000.and also print the Mth digit prime number between the range.

 

Input:

Input line contains three positive integers (T1 T2 M) separated by space where lower limit is T1 and upper limit is T2 and M is the position of the required digit prime number.

Line 1

T1 T2 M, where T1 is upper limit, T2 is lower limit and M is the position of the required digit prime number.


 

Constraints:

0 < T1 <= T2 < 1000000
0 < M

Output:

Print Mth digit prime number between T1 and T2(inclusive).

 

Line 1


For Valid Input,print

Mth digit prime number between T1 and T2.
Or
No number is present at this index

For Invalid Input,print
Invalid Input


Sample Input and Output

SNo.

Input

Output

1


25 100 5 

61

2


1 3 5

No number is present at this index

3


-5 3 a

Invalid Input

 

Note:

Participants submitting solutions in C language should not use functions from <conio.h> / <process.h> as these files do not exist in gcc

in Computers & Internet by (80 points) | 484 views

Please log in or register to answer this question.

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
0 answers
asked Aug 31, 2013 in Computers & Internet by anonymous | 499 views
0 like 0 dislike
0 answers
0 like 0 dislike
4 answers

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,219 questions
1,365 answers
558 comments
2,099 users