A257296 Arithmetic mean of the digits of n, multiplied by 10^(d-1) and rounded down, where d is the number of digits of n.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 30, 35, 40, 45, 50, 55, 60, 65
Offset: 0
Examples
For n = 12, a two-digit number, the average of the digits is 1.50000..., so a(12) = 15.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
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 *)
-
PARI
a(n)=sum(i=1,#n=digits(n),n[i])*10^(#n-1)\#n
Comments