login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358983
a(n) is the first emirp p that starts a sequence of n emirps x(1),...,x(n) with x(1) = p and x(k+1) = 2*x(k) - reverse(x(k)), but 2*x(n) - reverse(x(n)) is not an emirp.
0
13, 941, 1471, 120511, 368631127
OFFSET
1,1
EXAMPLE
a(3) = 1471 because 1471 is an emirp, 2*1471 - 1741 = 1201 is an emirp, and 2*1201 - 1021 = 1381 is an emirp, but 2*1381 - 1831 = 931 is not an emirp.
MAPLE
rev:= proc(n) local L, t;
L:= convert(n, base, 10);
add(L[-t]*10^(t-1), t=1..nops(L));
end proc:
g:= proc(n) local x, n, r;
t:= 0; x:= n;
do
r:= rev(x);
if r = x or not isprime(x) or not isprime(r) then return t fi;
t:= t+1;
x:= 2*x - r;
od
end proc:
V:= Vector(5): count:= 0:
for n from 13 by 2 while count < 5 do
v:= g(n);
if v > 0 and V[v] = 0 then
V[v]:= n; count:= count+1
fi
od:
convert(V, list);
CROSSREFS
Sequence in context: A274544 A376463 A267915 * A096084 A203708 A342811
KEYWORD
nonn,base,more
AUTHOR
J. M. Bergot and Robert Israel, Dec 08 2022
STATUS
approved