OFFSET
1,1
LINKS
EXAMPLE
3^0 = 1 and 3' = 1;
4^1 = 4 and 4' = 4;
1^3 + 4^3 + 2^3 = 73 and 143' = 73.
MAPLE
with(numtheory): P:= proc(q) local a, b, c, d, j, k, n, ok; for n from 3 to q do a:=[]; b:=n; ok:=0;
d:=n*add(op(2, p)/op(1, p), p=ifactors(n)[2]); a:=[]; b:=n; ok:=0;
for k from 1 to ilog10(n)+1 do if (b mod 10)>1 then ok:=1; fi; a:=[(b mod 10), op(a)]; b:=trunc(b/10); od; b:=-1; c:=0;
if ok=1 then while c<d do b:=b+1;
if b>0 then c:=add(a[k]^b, k=1..nops(a)); else for k from 1 to nops(a) do if a[k]=0 then c:=0; break;
else c:=c+1; fi; od; fi; od; if c=d then lprint(n, b); fi; fi; od; end: P(10^9);
MATHEMATICA
f[n_] := If[Abs@ n < 2, 0, n Total[#2/#1 & @@@ FactorInteger@ Abs@ n]]; Select[Range[3, 10^5], Function[k, IntegerQ@ SelectFirst[Range[0, 10], Function[d, If[MemberQ[d, 0] && # == 0, Total@ Power[d /. 0 -> Nothing, #] == f@ k, Total@ Power[d, #] == f@ k]]@ IntegerDigits@ k &]]] (* Michael De Vlieger, Mar 04 2016, Version 10, f(n) after Michael Somos at A003415 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Mar 04 2016
STATUS
approved