login
A393460
a(n) is the least prime p such that n - p is the reverse of a prime, where leading 0's are not allowed, or -1 if there is no such p.
2
2, 2, 3, 2, 3, 2, 3, -1, 5, 2, 3, 2, 2, 3, 2, 2, 3, 5, 5, 7, 7, 11, 13, 11, 11, 13, 13, 17, 19, 2, 2, 3, 2, 2, 3, 2, 2, 3, 5, 5, 7, 7, 11, 13, 11, 11, 13, 13, 17, 19, 17, 17, 19, 19, 23, 43, 23, 23, 31, 29, 29, 31, 29, 29, 31, 31, 53, 37, 37, 2, 3, 2, 2, 3, 2, 3, 7, 2, 3, 7, 5, 11, 7, 11, 17, 13
OFFSET
4,1
COMMENTS
Conjecture: a(n) = -1 only for n = 11.
LINKS
EXAMPLE
a(15) = 2 because 2 is prime and 15 - 2 = 13 is the reverse of the prime 31.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
P:= select(isprime, [2, seq(i, i=3..1000, 2)]):
revP:= sort(map(rev, P)):
nP:= nops(P):
V:= Vector(1000, -1):
for i from 1 to nP do
for j from 1 to nP while P[i]+revP[j] <= 1000 do
v:= P[i]+revP[j]; if V[v]=-1 then V[v]:= P[i] fi
od od:
convert(V[4..1000], list);
PROG
(Python)
from sympy import isprime
def a393460(n):
for p in range(2, n):
if isprime(p):
diff = n - p
if diff % 10 == 0:
continue
if isprime(int(str(diff)[::-1])):
return p
return -1
seq = [a393460(n) for n in range(4, 91)]
print(seq) # Aitzaz Imtiaz, Feb 20 2026
(PARI) a(n) = forprime(p=2, n, my(x=Vecrev(digits(n-p))); if (#x && x[1] && isprime(fromdigits(x)), return(p))); -1; \\ Michel Marcus, Feb 21 2026
CROSSREFS
Sequence in context: A275803 A060131 A343391 * A024677 A276856 A137467
KEYWORD
sign,base,look
AUTHOR
Robert Israel, Feb 15 2026
EXTENSIONS
Name edited by Michel Marcus, Feb 21 2026
STATUS
approved