login
A074857
Primes p such that all p-pal for p/2 < pal < p are nonprime, where pal is a palindrome.
1
2, 3, 17, 19, 23, 31, 37, 43, 53, 59, 137, 139, 151, 157, 179, 181, 191, 197, 199, 211, 307, 317, 337, 347, 367, 397, 599, 1423, 1433, 1453, 1483, 1493, 1523, 1543, 1583, 1613, 1693, 1723, 1733, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847
OFFSET
1,1
COMMENTS
Includes all primes p from 1.8 * 10^d to 2 * 10^d such that p - 2 is not a palindrome. - Robert Israel, Dec 23 2025
LINKS
EXAMPLE
59 is in the sequence because the palindromes between 29 and 59 are 33,44,55 and 59-55 = 4, 59-44 = 15, 59-33 = 26, all composite.
From Sean A. Irvine, Jan 31 2025: (Start)
2 is in the sequence because there are no palindromes between 1 and 2.
3 is in the sequence because the only palindrome between 3/2 and 3 is 2 and 3-2=1 is not prime.
23 is in the sequence because the only palindrome between 23/2 and 23 is 22 and 23-22=1 is not prime. (End)
MAPLE
N:=4; # for terms up to 10^N
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
Pals:= $0..9:
for d from 2 to N do
if d::even then
m:= d/2;
Pals:= Pals, seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1);
else
m:= (d-1)/2;
Pals:= Pals, seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1);
fi
od:
Pals:=[Pals]:
filter:= proc(p) uses ListTools;
isprime(p) and not ormap(isprime,
p -~ Pals[BinaryPlace(Pals, p/2)+1 .. BinaryPlace(Pals, p)])
end proc:
select(filter, [2, seq(i, i=3..10^N, 2)]); # Robert Israel, Dec 23 2025
CROSSREFS
Sequence in context: A090913 A176236 A171139 * A291281 A135931 A215323
KEYWORD
base,nonn,look
AUTHOR
Jason Earls, Sep 11 2002
EXTENSIONS
Missing 3 inserted by Sean A. Irvine, Jan 31 2025
STATUS
approved