OFFSET
1,1
COMMENTS
All terms have been verified up to k <= 20000.
For n <= 84000, the largest term is a(38541) = 188.
LINKS
James C. McMahon, Table of n, a(n) for n = 1..5000
EXAMPLE
a(3) = 21, because 3^21 = 10460353203, which has the smallest average of digits of ~2.45 for any 3^k and 1 < k <= 20000.
a(10) = -1, because the average of digits of 10^k decreases indefinitely as k increases.
MATHEMATICA
a[1]=2; a[n_]:=Module[{s=DigitSum[#]/IntegerLength[#]&/@(n^Range[2, 200])}, If[IntegerQ[Log10[n]], -2, SequencePosition[s, {Min[s]}][[1, 1]]]+1] (* Increase range of k for n^k when n>84000 *); Array[a, 80] (* James C. McMahon, Mar 21 2026 *)
CROSSREFS
KEYWORD
sign,base
AUTHOR
Dmitry Kamenetsky, Mar 09 2026
STATUS
approved
