OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3)= 347 is in the sequence because 347+3+4+7=361=19^2 and 347 and 19 are primes.
MAPLE
f:= proc(q) local m, d, nmin;
m:= q^2;
d:= ilog10(m)+1;
nmin:= m - 9*d;
nmin:= nmin + ((5-nmin) mod 6);
op(select(t -> t + convert(convert(t, base, 10), `+`)=m and isprime(t), {seq(n, n=nmin .. m-2, 6)}))
end proc:
f(2):= 2:
sort(map(f, [seq(ithprime(i), i=1..2000)]));
PROG
(PARI) is(n) = my(x=n+sumdigits(n)); isprimepower(x)==2
forprime(p=1, 6e6, if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Apr 02 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel and Will Gosnell, Apr 02 2019
STATUS
approved