OFFSET
0,3
COMMENTS
Coincides up to a(99) with the variant A004427 (= arithmetic mean of digits, rounded up). - M. F. Hasler, May 10 2015
0 <= a(n) <= 9. a(10*n + a(n)) = a(n). - Robert Israel, May 11 2015
LINKS
MAPLE
f:= proc(n) local L;
L:= convert(n, base, 10);
round(convert(L, `+`)/nops(L))
end proc:
map(f, [$0..100]); # Robert Israel, May 11 2015
MATHEMATICA
Round[Mean[IntegerDigits[#]]]&/@Range[0, 110]
PROG
(PARI) A257295(n)=round(sum(i=1, #n=digits(n), n[i])/#n) \\ ...Vecsmall(Str(n))...-48 is a little faster.
(PARI) a(n)=round(sumdigits(n)/#digits(n)) \\ Charles R Greathouse IV, May 11 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, May 10 2015
STATUS
approved