OFFSET
1,2
COMMENTS
Obviously n must be a perfect power. - Robert G. Wilson v
EXAMPLE
121 = 119 + 2 -> Sum_digits(119)=11; Sum_digits(2)=2 -> 11^2 = 121.
2744 = 2741 + 3 -> Sum_digits(2741)=14; Sum_digits(3)=3 -> 14^3 = 2744.
Also 2744 = 2732+12 = 2723+21 = 2714+30 = 2642+102 = 2633+111 = 2624+120 = 2543+201 = 2534+210 = 2444+300 = 2100+644 = 2010+734 = 2001+743 = 1742+1002 = 1733+1011 = 1724+1020 = 1643+1101 = 1634+1110 = 1544+1200.
MAPLE
P:=proc(n) local a, i, j, k, x, w; for i from 1 by 1 to n do if (i mod 1000)=0 then print("sono a:", i); fi; if (trunc(i/2))*2=i then a:=i/2+1; else a:=(i+1)/2; fi; for j from 1 to a do w:=0; k:=i-j+1; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; x:=0; k:=j-1; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; if ((w^x=i) or (x^w=i)) then print(i, i-j+1, j-1); fi od; od; end: P(10000);
MATHEMATICA
fQ[n_] := Block[{k = 0}, While[j = n - k; k < n && Plus @@ IntegerDigits[j]^Plus @@ IntegerDigits[k] != n, k++ ]; k != n]; lst = {}; Do[ If[GCD @@ Last /@ FactorInteger@n > 1 && fQ@n, Print@n; AppendTo[lst, n]], {n, 1934880}]; lst (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jun 13 2007, Jun 15 2007
EXTENSIONS
a(15)-a(18) from R. J. Mathar and Robert G. Wilson v, Jun 14 2007
STATUS
approved