OFFSET
1,1
COMMENTS
a(n) is the least prime p such that the sum of the quotient and remainder on division of p by the sum of digits of p is the n-th power of an integer.
LINKS
Robert Israel, Table of n, a(n) for n = 1..100
EXAMPLE
a(3) = 131 because 131 is prime, has sum of digits 5, 131 = 26*5 + 1 and 26 + 1 = 27 = 3^3 where 3 is prime; and 131 is the least prime that works.
MAPLE
g:= proc(t, M) local s, q, r, n;
for s from 2 to 9*M do
for r from s-1 to 1 by -1 do
q:= t-r;
n:= q*s+r;
if convert(convert(n, base, 10), `+`) = s and isprime(n) then return n fi;
if n >= 10^M then return -1 fi;
od od;
-1
end proc:
G:= proc(m) local i, M, found, v, r;
found:= false; r:= infinity;
for M from 3 while not found do
for i from 1 while ithprime(i)^m < 10^M do
v:= g(ithprime(i)^m, M);
if v > 0 then found:= true; r:= min(v, r) fi
od od:
r
end proc:
map(G, [$1..30]);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Oct 25 2022
STATUS
approved