All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Mirror, mirror (Posted on 2012-05-04) Difficulty: 3 of 5
What palindromic prime number of n digits reads the same upside down or when viewed in a mirror?

Some examples for n=2 or 3:
11, 101, 181.

How far can you go?

Rem: Only digits 0,l and 8 qualify.

No Solution Yet Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: computer solution -- count by length Comment 4 of 4 |
(In reply to computer solution by Charlie)

length count
 3      2
 5      1
 7      4
 9     12
11     26
13     62
15    173
17    392
19   1087
21   3197
23   8189
25  23354

Later, to compare expected numbers to the above:

There are 3^((n-1)/2) possible n-digit palindromes formed with 1, 0 and 8 that begin and end with 1.

An approximation to the number of prime numbers with n digits is 10^n/ln(10^n) - 10^(n-1)/ln(10^(n-1)) = 10^n/(ln(10)*n) - 10^(n-1)/(ln(10)*(n-1)), and this is out of 10^n such numbers, so the fraction of numbers of this length that are prime would be approximated by 1/(ln(10)*n) - 1/(10*ln(10)*n).

Multiplying this fraction by the number of palindromes, the result is 3^((n-1)/2)*(1/(ln(10)*n) - 1/(10*ln(10)*n)).

The expected number in each length category is then (rounded to an integer):

3             0
5             1
7             2
9             4
11            9
13            22
15            57
17            151
19            405
21            1099
23            3010
25            8309
27            23080

 

DEFDBL A-Z
FOR n = 3 TO 27 STEP 2
 PRINT n,
 expected = 3 ^ ((n - 1) / 2) * (1 / (LOG(10#) * n) - 1 / (10 * LOG(10#) * n))
 expected = INT(expected + .5)
 PRINT expected
NEXT

Edited on May 4, 2012, 5:24 pm
  Posted by Charlie on 2012-05-04 16:39:02

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information