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-3 of 3 results.

A004427 Arithmetic mean of digits of n (rounded up).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 1, 1, 1, 2, 2, 2, 3, 3
Offset: 0

Views

Author

Keywords

Comments

a(100)=1 is the first value that differs from the variant "... rounded to the nearest integer". - M. F. Hasler, May 10 2015

Crossrefs

Programs

  • Mathematica
    Ceiling[Mean[IntegerDigits[#]]]&/@Range[0,110] (* Harvey P. Dale, Aug 29 2014 *)
  • PARI
    A004427(n)=ceil(sum(i=1, #n=digits(n), n[i])/#n) \\ ...Vecsmall(Str(n))...-48 is a little faster. \\ M. F. Hasler, May 10 2015

Formula

From Reinhard Zumkeller, May 27 2010: (Start)
a(n) = ceiling(A007953(n)/A055642(n)); a(A000040(n)) = A074462(n);
A004426(n) <= a(n) with equality for n in A061383;
a(A178361(n)) = 1; a(A178362(n)) = 2; a(A178363(n)) = 3; a(A178364(n)) = 4; a(A178365(n)) = 5; a(A178366(n)) = 6; a(A178367(n)) = 7; a(A178368(n)) = 8; a(A178369(n)) = 9. (End)

A074461 Average digit (rounded down) in the decimal expansion of the n-th prime number.

Original entry on oeis.org

2, 3, 5, 7, 1, 2, 4, 5, 2, 5, 2, 5, 2, 3, 5, 4, 7, 3, 6, 4, 5, 8, 5, 8, 8, 0, 1, 2, 3, 1, 3, 1, 3, 4, 4, 2, 4, 3, 4, 3, 5, 3, 3, 4, 5, 6, 1, 2, 3, 4, 2, 4, 2, 2, 4, 3, 5, 3, 5, 3, 4, 4, 3, 1, 2, 3, 2, 4, 4, 5, 3, 5, 5, 4, 6, 4, 6, 6, 1, 4, 4, 2, 2, 3, 5, 3, 5, 5, 3, 4
Offset: 1

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 23 2002

Keywords

Examples

			prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, ... so the average digits rounded down are; 2, 3, 5, 7, (1+1)/2 = 1, (1+3)/2 = 2, (1+7)/2 = 4, (1+9)/2 = 5, floor((2+3)/2) = 2, ...
		

Crossrefs

Programs

  • PARI
    a(n)={my(v=digits(prime(n))); vecsum(v)\#v} \\ Andrew Howroyd, Jan 16 2020

Formula

a(n) = A004426(A000040(n)). - Reinhard Zumkeller, May 27 2010

Extensions

Offset corrected and terms a(21) and beyond from Andrew Howroyd, Jan 16 2020

A073342 Average digit (rounded to the nearest integer) in the decimal expansion of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 1, 2, 4, 5, 3, 6, 2, 5, 3, 4, 6, 4, 7, 4, 7, 4, 5, 8, 6, 9, 8, 1, 1, 3, 3, 2, 3, 2, 4, 4, 5, 2, 4, 3, 5, 4, 6, 3, 4, 4, 6, 6, 1, 2, 4, 4, 3, 5, 2, 3, 5, 4, 6, 3, 5, 4, 4, 5, 3, 2, 2, 4, 2, 4, 5, 5, 4, 6, 5, 4, 6, 5, 7, 6, 2, 4, 5, 2, 3, 3, 5, 4, 6, 5, 4, 4, 6, 7, 6, 5, 7, 3, 5, 3, 3, 3, 5, 6, 5, 7, 4, 6, 7, 6, 8, 2, 4, 3, 5, 5, 3, 4, 4, 6, 5, 7
Offset: 1

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 23 2002

Keywords

Examples

			For the prime 107 we have nearest((1+0+7)/3)=nearest(8/3)=3.
		

Crossrefs

Programs

  • Mathematica
    Floor[Mean[IntegerDigits[#]]+1/2]&/@Prime[Range[120]] (* Harvey P. Dale, Nov 22 2011 *)

Formula

a(n)=round(A007605(n)/A097944(n)). - R. J. Mathar, Sep 23 2008

Extensions

Changed offset to 1, added Cf. to A074462 and extended. - R. J. Mathar, Sep 23 2008
Showing 1-3 of 3 results.