|
|
A082439
|
|
Palindromic primes with middle digit 3.
|
|
1
|
|
|
3, 131, 10301, 11311, 13331, 14341, 16361, 19391, 32323, 35353, 71317, 76367, 77377, 79397, 94349, 97379, 98389, 1003001, 1043401, 1093901, 1123211, 1153511, 1163611, 1183811, 1193911, 1243421, 1253521, 1273721, 1303031, 1333331, 1343431, 1363631, 1463641
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
MAPLE
|
revdigs := proc(n)
local L, nL, j;
L:= convert(n, base, 10);
nL:= nops(L);
add(L[i]*10^(nL-i), i=1..nL);
end:
select(isprime, [3, seq(seq(n*10^(d+1)+3*10^d + revdigs(n), n=10^(d-1) .. 10^d-1), d= 1..4)]); # Robert Israel, Nov 11 2015
|
|
MATHEMATICA
|
ppmd3Q[n_]:=Module[{idn=IntegerDigits[n], len}, len=Length[idn]; OddQ[len] && idn==Reverse[idn]&&idn[[(len+1)/2]]==3]; Select[Prime[ Range[ 120000]], ppmd3Q] (* Harvey P. Dale, Feb 12 2015 *)
|
|
PROG
|
(Magma) [ p: p in PrimesUpTo(200000000) | IsOdd(d) and D[(d+1) div 2] eq 3 and D eq Reverse(D) where d is #D where D is Intseq(p) ]; // Vincenzo Librandi, Apr 12 2011
(Python)
from gmpy2 import is_prime
for i in range(1, 10**6):
s = str(i)
n = int(s+'3'+s[::-1])
if is_prime(n):
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|