OFFSET
0,3
COMMENTS
The reason for the factor 10^(d-1) in the definition is to produce an analog of A257294, i.e., give the first d digits of the mean value, for an "average" d-digit number. But since the arithmetic mean of the digits may be between 0 and 1, the situation is slightly different from the case of the geometric mean.
Also motivated by sequence A257829.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
For n = 12, a two-digit number, the average of the digits is 1.50000..., so a(12) = 15.
MAPLE
f:= proc(n) local d;
d:= ilog10(n);
floor(convert(convert(n, base, 10), `+`)/(d+1)*10^d)
end proc:
map(f, [$0..100]); # Robert Israel, May 10 2015
MATHEMATICA
Table[Floor[Mean[IntegerDigits[n]]10^(IntegerLength[n]-1)], {n, 0, 70}] (* Harvey P. Dale, Mar 11 2020 *)
PROG
(PARI) a(n)=sum(i=1, #n=digits(n), n[i])*10^(#n-1)\#n
CROSSREFS
KEYWORD
AUTHOR
M. F. Hasler, May 10 2015
STATUS
approved
