HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


145. 50586 - Prime Palindromes

Guest
• Review clarifications (2)

Volume problems

• 100. 50397 - The Number of Points ...
• 110. 50409 - Random Password Ge...
• 120. 50684 - Sum of prime numbers...
• 125. 50578 - Mersenne prime
• 130. 50652 - Prime Factorization
• 132. 50474 - Sum of Two Primes
• 135. 50572 - Palindromic Numbers
• 140. 50393 - Palindromic Numbers
• 145. 50586 - Prime Palindromes
• 148. 50412 - K numbers
• 150. 50375 - Area of Circles
• 160. 50388 - Number of Armstrong ...
• 160. 50571 - Armstrong Numbers - 2
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?
• 210. 50369 - Base Conversion

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Prime Palindromes

Shqip
A prime number is a natural number that has exactly two distinct natural number divisors: 1 and itself.
A palindromic number is a 'symmetrical' number like 16461, that remains the same when its digits are reversed.
A number is prime palindrome if it's at the same time prime and palindromic number. Write a program that finds the number of prime palindromic numbers between two given numbers: m and n.
For example: If m and n are given : 10000 12000 Then the prime palindromic numbers are: 10301 10501 10601 11311 11411.

Input specification
There will be two numbers in the input file which are between 1 ≤ n < m ≤ 100000.

Output specification
Find the number of prime palindromic numbers between the given numbers. If there is no prime palindromic number within the given range show 0 (zero).

Input
10000 12000
Output
5

Для отправки решений необходимо выполнить вход.

www.contester.ru