OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 210 is a member because 210 = 103+107 where 103 and 107 are consecutive primes, and its reversal 12 = 5+7 where 5 and 7 are consecutive primes.
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..50000, 2)]):
P2:= convert(P[1..-2]+P[2..-1], set):
A:= sort(convert(select(t -> member(rev(t), P2), P2), list));
MATHEMATICA
g = {}; For[m = 1, m <= 6800, m++ , n = FromDigits[Reverse[IntegerDigits[m]]]; If[NextPrime[(m + 1)/2, -1] + NextPrime[(m - 1)/2] == m && !PrimeQ[m/2] && NextPrime[(n + 1)/2, -1] + NextPrime[(n - 1)/2] == n && !PrimeQ[n/2], AppendTo[g, m]]]; Print[g] (* Samuel Harkness, Sep 19 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime, prevprime
def isA001043(n):
if n < 6: return n == 5
h = n//2
return not isprime(h) and n == prevprime(h) + nextprime(h)
def agen():
p, q, s = 2, 3, 5
while True:
if isA001043(int(str(s)[::-1])): yield s
p, q = q, nextprime(q); s = p+q
print(list(islice(agen(), 53))) # Michael S. Branicky, Sep 19 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Sep 18 2022
STATUS
approved