A283034 Numbers k such that k = (sum of digits of k)^(last digit of k).
1, 4913, 19683, 52521875, 24794911296, 68719476736, 271818611107, 1174711139837
Offset: 1
Examples
1 = 1^1, 4913 = (4+9+1+3)^3, 19683 = (1+9+6+8+3)^3, 52521875 = (5+2+5+2+1+8+7+5)^5.
Programs
-
Mathematica
Union[Reap[nd=1; Sow[1]; While[Ceiling[(10^(nd-1))^(1/9)] <= 9 nd, Do[ Do[v = s^e; If[Mod[v, 10] == e && Plus @@ IntegerDigits@ v == s, Sow[v]], {s, Ceiling[ (10^(nd-1))^(1/e)], Min[ Floor[10^(nd/e)], 9 nd]}], {e, 2, 9}]; nd++]][[2, 1]]] (* all terms, Giovanni Resta, Feb 27 2017 *)
-
VBA
Sub calcul() Sheets("Result").Select Range("A1").Select For i = 1 To 10000000 Sum = 0 For k = 1 To Len(i) Sum = Sum + Mid(i, k, 1) Next If Sum ^Mid(i, len(i), 1)= i Then ActiveCell.Value = i ActiveCell.Offset(1, 0).Select End If Next End Sub
Extensions
a(5)-a(8) from Giovanni Resta, Feb 27 2017
Comments