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.

Previous Showing 11-13 of 13 results.

A074464 Average digit (rounded down) in the decimal expansion of a prime number p, where 2^p-1 is a Mersenne prime.

Original entry on oeis.org

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

Views

Author

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

Keywords

Examples

			Prime numbers for Mersenne are 2, 3, 5, 7, 13, 17, 19, 31, 61, ..., so the averages of digits rounded down are 2, 3, 5, 7, (1+3)/2 = 2, (1+7)/2 = 4, (1+9)/2 = 5, (3+1)/2 = 2, floor((6+1)/2) = 3, ...
		

Crossrefs

Programs

  • Mathematica
    Floor[Mean[IntegerDigits[#]]]&/@MersennePrimeExponent[Range[47]] (* Harvey P. Dale, Apr 19 2019 *)

Formula

a(n) = A004426(A000043(n)). - Michel Marcus, Aug 04 2018

Extensions

a(21)-a(47) from Ivan Panchenko, Aug 03 2018
a(48) from Amiram Eldar, Oct 16 2024

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))

A285093 Corresponding values of arithmetic means of digits of numbers from A061383.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Apr 14 2017

Keywords

Crossrefs

Cf. A061383 (numbers with integer arithmetic mean of digits in base 10).
Sequences of numbers n such that a(n) = k for k = 1 - 9: A061384 (k = 1), A061385 (k = 2), A061386 (k = 3), A061387 (k = 4), A061388 (k = 5), A061423 (k = 6), A061424 (k = 7), A061425 (k = 8), A002283 (k = 9).
Cf. A004426, A004427, A257295 (supersequences).

Programs

  • Magma
    [0] cat [&+Intseq(n) / #Intseq(n): n in [1..100000] | &+Intseq(n) mod #Intseq(n) eq 0];
    
  • PARI
    lista(nn) = {for (n=0, nn, if (n, d = digits(n), d = [0]); if (!( vecsum(d) % #d), print1(vecsum(d)/#d, ", ")););} \\ Michel Marcus, Apr 15 2017

Formula

a(n) = A007953(A061383(n)) / A055642(A061383(n)) for n >= 1.
Previous Showing 11-13 of 13 results.