OFFSET
1,1
COMMENTS
If "sumdigit" denotes the sum of the digits of a number then these are the numbers n such that n=sumdigit(m^k)=sumdigit(k^m).
Two banal cases are not considered: 1) m=k because m^k=k^m and the sum of the digits is automatically equal for both the numbers; 2) powers of 10 because sumdigit(10^a)=1 for any integer a. The same number can be generated by different pairs: 477 cames from sumdigit(54^63)=sumdigit(63^54) and sumdigit(90^120)=sumdigit(120^90) 2349 cames from sumdigit(216^222)=sumdigit(222^216), sumdigit(216^225)=sumdigit(225^216) and sumdigit(219^222)=sumdigit(222^219)
EXAMPLE
270 = sumdigit(36^39) = sumdigit(39^36);
1152 = sumdigit(114^126) = sumdigit(126^114);
2133 = sumdigit(204^213) = sumdigit(213^204).
MAPLE
P:=proc(n)local i, j, k, w, x, y; for i from 1 by 1 to n do for j from 1 by 1 to n do w:=0; x:=0; k:=i^j; y:=j^i; while k>0 do w:=w+k-trunc(k/10)*10; k:=trunc(k/10); od; while y>0 do x:=x+y-trunc(y/10)*10; y:=trunc(y/10); od; if (w=x) and (w<>1) and (i<j) then print(i, j, w); fi; od; od; end: P(500);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Nov 03 2006, Nov 29 2006
STATUS
approved