cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, May 10 2015

Keywords

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.

Examples

			For n = 12, a two-digit number, the average of the digits is 1.50000..., so a(12) = 15.
		

Crossrefs

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

Formula

a(n) = floor(A007953(n)/A055642(n)*10^(A055642(n)-1))
Showing 1-1 of 1 results.