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.

A301273 Numerator of mean of first n primes.

Original entry on oeis.org

2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 167, 568, 639, 712, 791, 38, 321, 212, 1161, 1264, 1371, 1480, 531, 1720, 1851, 1988, 2127, 2276, 809, 2584, 2747, 2914, 3087, 3266, 1149, 3638, 3831, 4028, 4227, 4438, 4661
Offset: 1

Views

Author

N. J. A. Sloane, Mar 18 2018

Keywords

Examples

			The means are 2, 5/2, 10/3, 17/4, 28/5, 41/6, 58/7, 77/8, 100/9, 129/10, 160/11, 197/12, 238/13, 281/14, 328/15, 381/16, 440/17, 167/6, 568/19, 639/20, 712/21, 791/22, 38, 321/8, 212/5, ...
		

Crossrefs

Mean and variance of primes: A301273/A301274, A301275/A301276, A301277, A273462.

Programs

  • Maple
    m := n -> add(ithprime(j),j=1..n)/n;
    m1:=[seq(m(n),n=1..100)];
    m2:=map(numer,m1); # A301273
    m3:=map(denom,m1); # A301274
    m4:=map(round,m1); # A301277
  • Mathematica
    a[n_] := Prime @ Range[n] // Mean // Numerator;
    a /@ Range[100] (* Jean-François Alcover, Nov 16 2019 *)
  • Python
    from fractions import Fraction
    from sympy import prime
    A301273_list, mu = [], Fraction(0)
    for i in range(1,10001):
        mu += (prime(i)-mu)/i
        A301273_list.append(mu.numerator) # Chai Wah Wu, Mar 22 2018