OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
MAPLE
filter:= proc(n) local t;
isprime(n*add(t[2]/t[1], t=ifactors(n)[2]))
end proc:
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
N:= 100: # for a(1) to a(N)
Res:= 6: count:= 1:
for d from 2 while count < N do
if d::even then
m:= d/2;
for n from 10^(m-1) to 10^m-1 while count < N do
v:= n*10^m + digrev(n);
if filter(v) then Res:= Res, v; count:= count+1 fi;
od
else
m:= (d-1)/2;
for n from 10^(m-1) to 10^m-1 while count < N do
for y from 0 to 9 while count < N do
v:= n*10^(m+1)+y*10^m+digrev(n);
if filter(v) then Res:= Res, v; count:= count+1 fi;
od od:
fi
od:
Res; # Robert Israel, May 09 2023
MATHEMATICA
d[0] = d[1] = 0; d[n_] := n * Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Range[30003], PalindromeQ[#] && PrimeQ[d[#]] &] (* Amiram Eldar, May 09 2022 *)
PROG
(Magma) f:=func<n |n le 1 select 0 else n*(&+[Factorisation(n)[i][2] / Factorisation(n)[i][1]: i in [1..#Factorisation(n)]])>; pal:=func<n|Intseq(n) eq Reverse(Intseq(n))>; [n:n in [2..30003]| pal(n) and IsPrime(Floor(f(n)))];
(PARI) ad(n) = vecsum([n/f[1]*f[2]|f<-factor(n+!n)~]); \\ A003415
isok(m) = my(d); isprime(ad(m)) && (d=digits(m)) && (d==Vecrev(d)); \\ Michel Marcus, May 09 2022
(Python)
from itertools import chain, count, islice
from sympy import isprime, factorint
def A353703_gen(): # generator of terms
return filter(lambda n:isprime(sum(n*e//p for p, e in factorint(n).items())), chain.from_iterable(chain((int((s:=str(d))+s[-2::-1]) for d in range(10**l, 10**(l+1))), (int((s:=str(d))+s[::-1]) for d in range(10**l, 10**(l+1)))) for l in count(0)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, May 08 2022
STATUS
approved