A252357 Numbers n of the form p^m where p is prime and m>0 such that the digit sum of n is p.
2, 3, 5, 7, 2401, 4913, 27512614111, 271818611107, 1174711139837, 45848500718449031, 73742412689492826049, 21048519522998348950643, 146853371345156431381127623, 240984500018808097135911707, 283956682347124706942551243009, 2759031540715333904109053133443
Offset: 1
Examples
2401 is in the sequence because 2401 = 7^4 and 2+4+0+1 = 7.
Programs
-
Maple
nn:=2000: for p from 1 to 15 do : for m from 1 to nn do:n:=ithprime(m)^p: y:=convert(n,base,10):n1:=nops(y): s1:=sum('y[i]', 'i'=1..n1): if s1=ithprime(m) then printf(`%d, `,n): else fi: od: od:
-
Mathematica
a252357[n_Integer] := Select[Range[n], PrimeQ[Plus @@ IntegerDigits[#]] && IntegerQ[Log[Plus @@ IntegerDigits[#], #]] &]; a252357[10^5] (* Michael De Vlieger, Dec 17 2014 *)
Comments