[go: up one dir, main page]

login
A356740
a(n) is the least emirp that begins a sequence of exactly n emirps under the map p -> (p*R(p)) mod (p+R(p)), where R(p) is the digit reversal of p.
1
13, 389, 15013, 7149589, 1471573153
OFFSET
1,1
EXAMPLE
a(3) = 15013 because it is an emirp, so is (15013 * 31051) mod (15013+31051) = 983, and so is (983 * 389) mod (983 + 389) = 971, but not (971 * 179) mod (971 + 179), and this is the first emirp that works.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
F:= proc(p) option remember; local k, q, r, s;
if not isprime(p) then return 0 fi;
q:= rev(p);
if q=p or not isprime(q) then return 0 fi;
r:= (p*q) mod (p+q);
1+procname(r);
end proc:
V:= Vector(4): count:= 0:
for p from 13 by 2 while count < 4 do
v:= F(p);
if v > 0 and V[v] = 0 then V[v]:= p; count:= count+1; fi;
od:
convert(V, list);
PROG
(PARI)
R(p)=fromdigits(Vecrev(digits(p)))
f(p)=my(r=R(p)); (p*r)%(p+r)
is(p)=my(r=R(p)); isprime(p)&&p!=r&&isprime(r)
card(x)=my(c=is(x), u=[]); while(is(x)&&is(f(x)), c++; u=concat(u, x); if(vecsearch(vecsort(u), f(x))==0, u=concat(u, f(x)); x=f(x), c--; break)); c
a(n)=forprime(k=2, +oo, if(card(k)==n, return(k))) \\ Jean-Marc Rebert, Sep 09 2022
CROSSREFS
KEYWORD
nonn,base,more,less
AUTHOR
J. M. Bergot and Robert Israel, Sep 04 2022
EXTENSIONS
a(5) from Jean-Marc Rebert, Sep 08 2022
STATUS
approved