%I #24 Aug 04 2017 20:37:34
%S 1,1,1,2,2,2,2,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,
%T 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,
%U 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
%N Floor of the average gap between consecutive primes among the first n primes, for n > 1.
%C The minimum n to evaluate a gap is 2, then n must be larger than 1. The average gap between consecutive primes computed over the first n primes is given by (1/(n-1))*Sum_{i=1..n-1} (prime(i+1) - prime(i)) or simply by (prime(n) - 2)/(n-1).
%H Robert Israel, <a href="/A286888/b286888.txt">Table of n, a(n) for n = 2..10000</a>
%F a(n)= floor((prime(n) - 2)/(n - 1)).
%F floor(log(n) + log(log(n)) - 1) <= a(n) <= floor(log(n) + log(log(n)) + 1). - _Robert Israel_, Aug 04 2017
%e a(3)=1 because the two gaps between consecutive primes among the first three primes are 3-2 = 1 and 5-3 = 2, the average gap is (1+2)/2 = 3/2, and the floor of 3/2 is 1.
%e a(4)=1 because the three gaps between consecutive primes among the first four primes are 3-2 = 1, 5-3 = 2 and 7-5 = 2, the average gap is (1+2+2)/3 = 5/3, and the floor of 5/3 is 1.
%p seq(floor((ithprime(n)-2)/(n-1)),n=2..200); # _Robert Israel_, Aug 04 2017
%t nmax=132;
%t Table[Floor[(Prime[n] - 2)/(n - 1)], {n, 2, nmax}]
%Y Cf. A001223.
%K nonn
%O 2,4
%A _Andres Cicuttin_, Jul 22 2017
|