login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers k such that k = (sum of digits of k)^(last digit of k).
0

%I #20 Jul 24 2021 01:11:35

%S 1,4913,19683,52521875,24794911296,68719476736,271818611107,

%T 1174711139837

%N Numbers k such that k = (sum of digits of k)^(last digit of k).

%C The check must be done up to 10^22 (then for 23 digits in a number max result can be (23*10)^9 = 4, 6*10^20 < 10^22).

%e 1 = 1^1,

%e 4913 = (4+9+1+3)^3,

%e 19683 = (1+9+6+8+3)^3,

%e 52521875 = (5+2+5+2+1+8+7+5)^5.

%t 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 *)

%o (VBA)

%o Sub calcul()

%o Sheets("Result").Select

%o Range("A1").Select

%o For i = 1 To 10000000

%o Sum = 0

%o For k = 1 To Len(i)

%o Sum = Sum + Mid(i, k, 1)

%o Next

%o If Sum ^Mid(i, len(i), 1)= i Then

%o ActiveCell.Value = i

%o ActiveCell.Offset(1, 0).Select

%o End If

%o Next

%o End Sub

%Y Cf. A007953, A010879, A023106.

%K nonn,base,fini,full

%O 1,2

%A _Shmelev Aleksei_, Feb 27 2017

%E a(5)-a(8) from _Giovanni Resta_, Feb 27 2017