OFFSET
1,1
COMMENTS
Suggested in an email from J. M. Bergot.
It appears that in most cases, p+q+r = 3*q and is a palindrome. This occurs for 109 of the 122 terms < 5*10^9.
EXAMPLE
a(3) = 17 is a term because 17, 19, 23 are consecutive primes with 17 + 19 + 23 = 59 and the reverse of 59 is 95 which is divisible by 19.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
q:= 2: r:= 3:
R:= NULL: count:= 0:
while count < 50 do
p:= q; q:= r; r:= nextprime(r);
x:= rev(p+q+r);
if x mod p = 0 or x mod q = 0 or x mod r = 0 then count:= count+1; R:= R, p;
fi;
od:
R;
MATHEMATICA
q[tri_] := AnyTrue[tri, Divisible[IntegerReverse[Total[tri]], #] &]; Select[Partition[Prime[Range[250000]], 3, 1], q][[;; , 1]] (* Amiram Eldar, Dec 28 2022 *)
PROG
(Python)
from sympy import nextprime
from itertools import count, islice
def agen(): # generator of terms
p, q, r = 2, 3, 5
while True:
t = int(str(p+q+r)[::-1])
if any(t%s == 0 for s in (p, q, r)): yield p
p, q, r = q, r, nextprime(r)
print(list(islice(agen(), 19))) # Michael S. Branicky, Dec 27 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 27 2022
STATUS
approved