login
A351729
a(n) is the least prime that starts a sequence of exactly n primes under the iteration p -> p + reverse(p) + 1.
0
7, 3, 5, 2, 7070879, 700839449, 7700584787999
OFFSET
1,1
EXAMPLE
a(3) = 5 because 5 starts the sequence of 3 primes 5 -> 5+5+1 = 11 -> 11+11+1 = 23, the next iteration 23+32+1 = 56 not being prime.
MAPLE
rev:= proc(x) local L, i;
L:= convert(x, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
f:= proc(n) option remember;
local x;
x:= n + rev(n)+1;
if isprime(x) then 1+procname(x) else 1 fi
end proc:
W:= Array(1..5):
p:= 1: count:= 0:
while count < 5 do
p:= nextprime(p);
v:= f(p);
if W[v] = 0 then W[v]:= p; count:= count+1 fi
od:
convert(W, list);
MATHEMATICA
With[{s = Array[-1 + Length@ NestWhileList[# + IntegerReverse[#] + 1 &, #, PrimeQ] &, 2^23]}, Array[FirstPosition[s, #][[1]] &, 5]] (* Michael De Vlieger, Feb 17 2022 *)
CROSSREFS
Sequence in context: A231190 A021140 A171036 * A304658 A253298 A155987
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Feb 17 2022
EXTENSIONS
a(6)-a(7) from Martin Ehrenstein, Mar 05 2022
STATUS
approved