OFFSET
1,1
LINKS
K. D. Bajpai and Jens Kruse Andersen, Table of n, a(n) for n = 1..10000 (first 274 terms from K. D. Bajpai)
EXAMPLE
37 is in the sequence because it is prime. Also, 37 - (3 + 7 ) = 27 = 3^3: a perfect cube.
743 is in the sequence because it is prime. Also, 743 - (7 + 4 + 3) = 729 = 9^3: a perfect cube.
MAPLE
dmax:= 9; # to get all entries < 10^dmax
cmax:= floor(10^(dmax/3));
count:= 0;
for m from 0 to cmax do
for p from m^3 to m^3 + 9*dmax do
if p - convert(convert(p, base, 10), `+`) = m^3 and isprime(p) then
count:= count+1;
A[count]:= p;
fi
od
od;
{seq(A[i], i=1..count)}; # Robert Israel, Jul 15 2014
MATHEMATICA
Select[Prime[Range[200000]], IntegerQ[CubeRoot[# - Apply[Plus, IntegerDigits[#]]]] &]
PROG
(PARI)
digsum(n) = my(d=eval(Vec(Str(n)))); sum(i=1, #d, d[i])
s=[]; forprime(p=2, 2002000, if(ispower(p-digsum(p), 3), s=concat(s, p))); s \\ Colin Barker, Jul 15 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Jul 11 2014
STATUS
approved