OFFSET
1,3
COMMENTS
Variance here is the sample variance unbiased estimator. - Chai Wah Wu, Mar 22 2018
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
Joel E. Cohen, Statistics of Primes (and Probably Twin Primes) Satisfy Taylor’s Law from Ecology, The American Statistician, 70 (2016), 399-404.
EXAMPLE
The variances are 0, 1/2, 7/3, 59/12, 64/5, 581/30, 649/21, 2287/56, 1001/18, 2443/30, 5669/55, 17915/132, 6665/39, 36637/182, 3529/15, 22413/80, 22813/68, 13065/34, 75865/171, 191819/380, 58778/105, 289013/462, 7627/11, 141973/184, 5213/6, 628001/650, ...
MAPLE
v := n -> 1/(n-1) * add((ithprime(i) add(ithprime(j), j=1..n)/n)^2, i=1..n );
v1:= [0, seq(v(n), n=2..70)];
MATHEMATICA
a[n_] := If[n == 1, 0, Variance[Prime[Range[n]]] // Numerator];
a /@ Range[100] (* Jean-François Alcover, Oct 27 2019 *)
PROG
(Python)
from fractions import Fraction
from sympy import prime
mu, variance = Fraction(prime(1)), Fraction(0)
A301275_list = [variance.numerator]
for i in range(2, 10001):
datapoint = prime(i)
newmu = mu+(datapoint-mu)/i
variance = (variance*(i-2) + (datapoint-mu)*(datapoint-newmu))/(i-1)
mu = newmu
A301275_list.append(variance.numerator) # Chai Wah Wu, Mar 22 2018
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
N. J. A. Sloane, Mar 18 2018
STATUS
approved