%I #52 Sep 22 2015 11:31:28
%S 4,10,12,15,16,18,28,39,40,52,58,63,69,72,82,87,93,100,106,120,123,
%T 126,128,138,144,186,195,212,213,214,222,225,249,263,273,274,282,286,
%U 292,294,313,321,322,339,347,375,381,386,388,400,402,426,432,436,448,454
%N Numbers n such that the equation Sd(n^k) = Sd(k^n) is satisfied for a k < n, where Sd(x) is the sum of the digits of x.
%C 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.
%H Paolo P. Lava, <a href="/A239055/b239055.txt">Table of n, a(n) for n = 1..100</a>
%e 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.
%p S:=proc(s) local w,j; w:=convert(s,base,10); sum(w[j],j=1..nops(w)); end:
%p P:=proc(q) local k,n; for n from 1 to q do k:=0;
%p while S(n^k)<>S(k^n) do k:=k+1; od; if k<n then print(n); fi; od;
%p end: P(10^5);
%t Select[Range@ 454, AnyTrue[Range[# - 1], Function[x, Total@ IntegerDigits[#^x] == Total@ IntegerDigits[x^#]]] &] (* _Michael De Vlieger_, Sep 22 2015, Version 10 *)
%o (PARI) isok(n) = {for (k=1, n-1, if (sumdigits(n^k)==sumdigits(k^n), return (1)););} \\ _Michel Marcus_, Sep 22 2015
%Y Cf. A007953.
%K nonn,base
%O 1,1
%A _Paolo P. Lava_, Apr 02 2014