The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+11 votes
A palindrome is a sequence of digits which reads the same backward or forward. For example, 7447, 1001 are palindromes, but 7455, 1201 are not palindromes. How many 8 digit prime palindromes are there?
asked in Combinatory by (269 points)
retagged by | 363 views

8 digit palindrome = 9*10*10*10 = 9000
but how to get 8 digit prime palindromes ?

4 Answers

+11 votes
Best answer
I think the answer should be 0, as any even digit palindrome(other than 11) cannot be prime. Even digit palindromes will always be divisible by 11(you can check the divisibility test by 11).
answered by (171 points)
selected by
A number is divisible by 11. When the difference between the sum of its alternating digits is divisible by 11 (scanned from left to right completely).
For Ex:

2772 has the alternating sum of digits 2-7+7-2 = 0. Since 0 is divisible by 11, so is 2772.

Similarly, for 31415, the alternating sum of digits is 3-1+4-1+5 = 10. This is not divisible by 11, so 31415 is not divisible by 11.
+1 vote
answered by Veteran (11.2k points)
0 votes

Let the digits of our 8-digit palindrome n be d1d2d3d4d4d3d2d1. Then the palindrome has the form


Such n cannot be prime because gcd(10000001,1000010,100100,11000)=11.

So there are NO 8-digit prime palindromes. (However, there are prime palindromes with an odd number of digits, e.g. 101101, 1030110301, 9868998689, 98010899801089.)

The correct answer is 0.

answered by Veteran (16.5k points)
what had been the answer if 9 digits prime palindrome was given?
–1 vote
i think answer will  be 9*10^3   bcz

9*10*10*10*1*1*1*1 =9000  and each no in multiplication shows the digit place
answered by Boss (5.1k points)

In the above question, we have to find number of 8 digit prime palindromes but your answer includes both prime and non-prime palindromes. 

For ex- 20000002 
Is it a prime palindrome. ??

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

34,234 questions
40,919 answers
39,834 users