|
|
A173071
|
|
Palindromic mountain primes.
|
|
3
|
|
|
131, 151, 181, 191, 12421, 12721, 12821, 13831, 13931, 14741, 17971, 1235321, 1245421, 1257521, 1268621, 1278721, 1456541, 1469641, 1489841, 1579751, 1589851, 123484321, 123494321, 123575321, 136797631, 167898761, 12345854321
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(6) = 12721; is a palindromic mountain prime.
. . . . .
. . . . .
. . 7 . .
. . . . .
. . . . .
. . . . .
. . . . .
. 2 . 2 .
1 . . . 1
|
|
MAPLE
|
a := proc (n) local rev, n1: rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: n1 := convert(n, base, 10): if n1[1]=1 and isprime(n) = true and rev(n) = n and n1[1] < n1[2] and n1[2] < n1[3] and n1[3] < n1[4] then n else end if end proc: seq(a(n), n = 1000000 .. 9999999); # this program works only for 7-digit numbers; easily adjustable for other (2k+1)-digit numbers # Emeric Deutsch, Mar 09 2010
|
|
PROG
|
(Python)
from itertools import combinations
from gmpy2 import is_prime
for l in range(1, 10):
for i in combinations('23456789', l):
s = '1'+''.join(i)
p = int(s+s[l-1::-1])
if is_prime(p):
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,fini,full
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|