OFFSET
1,1
COMMENTS
Obviously if k=n then Sd(n^k)=Sd(k^n). The sequence lists the numbers n whose minimum k that satisfies the equation is less than n.
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..100
EXAMPLE
For n = 16 the minimum k is 14. In fact 16^14 = 72057594037927936 and the sum of its digits is 85 while 14^16 = 2177953337809371136 and the sum of its digits is, again, 85.
MAPLE
S:=proc(s) local w, j; w:=convert(s, base, 10); sum(w[j], j=1..nops(w)); end:
P:=proc(q) local k, n; for n from 1 to q do k:=0;
while S(n^k)<>S(k^n) do k:=k+1; od; if k<n then print(n); fi; od;
end: P(10^5);
MATHEMATICA
Select[Range@ 454, AnyTrue[Range[# - 1], Function[x, Total@ IntegerDigits[#^x] == Total@ IntegerDigits[x^#]]] &] (* Michael De Vlieger, Sep 22 2015, Version 10 *)
PROG
(PARI) isok(n) = {for (k=1, n-1, if (sumdigits(n^k)==sumdigits(k^n), return (1)); ); } \\ Michel Marcus, Sep 22 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Apr 02 2014
STATUS
approved