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 21-28 of 28 results.

A074462 Average digit (rounded up) in the decimal expansion of prime(n).

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, 2, 3, 4, 2, 4, 2, 4, 5, 5, 3, 5, 4, 5, 4, 6, 4, 4, 5, 6, 7, 2, 3, 4, 5, 3, 5, 3, 3, 5, 4, 6, 4, 6, 4, 5, 5, 4, 2, 3, 4, 3, 5, 5, 6, 4, 6, 6, 5, 7, 5, 7, 7, 2, 5, 5, 3, 3, 4, 6, 4, 6, 6, 4, 5, 6, 7, 7, 5, 8, 3, 5, 3, 4, 4, 6, 6, 5, 7, 5, 7, 7, 6, 8, 3, 5, 4, 5, 6, 4, 4, 5, 6, 5, 7
Offset: 1

Views

Author

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

Keywords

Examples

			The prime numbers begin with 2,3,5,7,11,13,17,19,23,... so the average digits rounded up are 2, 3, 5, 7, (1+1)/2=1, (1+3)/2=2, (1+7)/2=4, (1+9)/2=5, ceiling((2+3)/2)=3, ...
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Mean[IntegerDigits[p]]],{p,Prime[Range[120]]}] (* Harvey P. Dale, Nov 06 2022 *)
  • PARI
    a(n) = my(d=digits(prime(n))); ceil(vecsum(d)/#d); \\ Michel Marcus, Apr 23 2022

Formula

a(n) = ceiling(A007605(n)/A097944(n)). - R. J. Mathar, Sep 23 2008
a(n) = A004427(A000040(n)). - Reinhard Zumkeller, May 27 2010

Extensions

Offset changed to 1, cf. to A073342 added, and extended by R. J. Mathar, Sep 23 2008

A178404 Numbers such that the rounded up arithmetic mean of their digits equals their digital root.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100, 149, 158, 167, 176, 185, 194, 239, 248, 257, 266, 275, 284, 293, 329, 338, 347, 356, 365, 374, 383, 392, 419, 428, 437, 446, 455, 464, 473, 482, 491, 509, 518, 527, 536, 545, 554, 563, 572, 581, 590, 608, 617, 626, 635
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2010

Keywords

Comments

A004427(a(n)) = A010888(a(n)); complement of A178405.

Examples

			From _Reinhard Zumkeller_, May 28 2010: (Start)
1093 --> 1+0+9+3=13 --> A010888(1093) = 1+3 = 4 and also
1093 --> 1+0+9+3=13 --> A004427(1093) = ceiling(13/4) = 4,
therefore 1093 is a term: a(100) = 1093. (End)
		

Crossrefs

Programs

  • Maple
    A178404 := proc(n) option remember: local k: if(n=1)then return 0: fi: k:=procname(n-1)+1: do if(ceil(add(d, d=convert(k,base,10))/length(k))-1 = (k-1) mod 9)then return k: fi: k:=k+1: od: end: seq(A178404(n),n=1..57); # Nathaniel Johnston, May 04 2011
  • Mathematica
    amdrQ[n_]:=NestWhile[Total[IntegerDigits[#]]&,n,#>9&]==Ceiling[ Mean[ IntegerDigits[n]]]; Select[Range[0,1000],amdrQ] (* Harvey P. Dale, Oct 10 2013 *)

A178405 Numbers such that the rounded up arithmetic mean of their digits differs from their digital root.

Original entry on oeis.org

11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2010

Keywords

Comments

A004427(a(n)) <> A010888(a(n)); complement of A178404.

A180157 Arithmetic mean of digits is not an integer.

Original entry on oeis.org

10, 12, 14, 16, 18, 21, 23, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 61, 63, 65, 67, 69, 70, 72, 74, 76, 78, 81, 83, 85, 87, 89, 90, 92, 94, 96, 98, 100, 101, 103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119, 121, 122, 124, 125
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

Complement of A061383; A180160(a(n)) > 0;
A004426(a(n)) <> A004427(a(n)).
It seems 'obvious' that a(n) ~ n; is this true? - Charles R Greathouse IV, Feb 06 2013

Crossrefs

Programs

  • Mathematica
    Select[Range[200],!IntegerQ[Mean[IntegerDigits[#]]]&]  (* Harvey P. Dale, Mar 27 2011 *)
  • PARI
    is(n)=my(v=digits(n));sum(i=1,#v,v[i])%#v>0 \\ Charles R Greathouse IV, Feb 06 2013

A257295 Arithmetic mean of the digits of n, rounded to the nearest integer.

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, 0, 1, 1, 1, 2, 2, 2, 3
Offset: 0

Views

Author

M. F. Hasler, May 10 2015

Keywords

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

Crossrefs

Programs

  • 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]
  • 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

Formula

a(n) = round(A007953(n)/A055642(n)).
A004426(n) <= a(n) <= A004427(n).

A074463 Average digit (rounded up) 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, 4, 9, 3, 4, 3, 5, 5, 2, 4, 4, 4, 4, 8, 6, 2, 6, 3, 4, 6, 5, 2, 4, 4, 7, 6, 6, 6, 5, 4, 6, 5, 4, 4, 6, 4, 5, 6, 4, 4, 6
Offset: 1

Views

Author

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

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{id = IntegerDigits@ n}, Ceiling[Plus @@ id/Length@ id]]; lst = { (* terms from A000043 *) }; f@# & /@ lst (* Robert G. Wilson v, Jun 26 2013 *)
    Ceiling[Mean[IntegerDigits[#]]]&/@MersennePrimeExponent[Range[47]] (* Harvey P. Dale, Feb 01 2023 *)

Formula

a(n) = A004427(A000043(n)). - Amiram Eldar, Oct 16 2024

Extensions

a(43)-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 21-28 of 28 results.