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.
%I A342877 #38 May 07 2021 16:00:17 %S A342877 1,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,0,1,0,1,0, %T A342877 1,1,0,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0, %U A342877 0,1,1,1,1,0,1,1,0,1,1,0,1,0,1,0,1,1,0,0,0,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,1,1 %N A342877 a(n) = 1 if the average distance between consecutive first n primes is greater than that of the first n-1 primes, otherwise a(n) = 0, for n > 2. %C A342877 The average distance between consecutive primes among the first n primes tends to increase with n. This average distance always changes when n is increased to n + 1, but it seems that most of the times this distance decreases. See a log-linear scatter plot of (1/n) Sum_{i=1..n} a(i) in Links. %C A342877 Conjecture: lim_{n->infinity} (1/n) Sum_{i=1..n} a(i) < 1/2. %C A342877 In support of the conjecture: If it is assumed, as an approximation, that position of primes follows a Poisson point process then the distance between consecutive primes is a stochastic variable with exponential probability distribution function. The probability that an exponentially distributed stochastic variable takes a value larger than the mean value is about 0.367879. %H A342877 Andres Cicuttin, <a href="/A342877/a342877_3.png">Log-linear scatter plot of (1/n) Sum_{i=1..n} a(i) for first 2^18 primes</a>. %H A342877 Wikipedia, <a href="https://en.wikipedia.org/wiki/Poisson_point_process">Poisson point process</a> %H A342877 Wikipedia, <a href="https://en.wikipedia.org/wiki/Exponential_distribution">Exponential distribution</a> %H A342877 Yamasaki, Yasuo and Yamasaki, Aiichi, <a href="https://repository.kulib.kyoto-u.ac.jp/dspace/bitstream/2433/84326/1/0887-10.pdf">On the Gap Distribution of Prime Numbers</a>, 数理解析研究所講究録 (1994), 887: 151-168. %H A342877 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %e A342877 a(3) = 1 because the average distance between consecutive first three primes {2,3,5} is (5 - 2)/2 = 3/2 which is greater than the average distance between consecutive first two primes {2,3} which is (3-2)/1 = 1. %e A342877 a(6)=0 because the average distance between consecutive first six primes {2,3,5,7,11,13} is (13 - 2)/5 = 11/5 which is smaller than the average distance between consecutive first five primes {2,3,5,7,11} which is (11 - 2)/4 = 9/4. %t A342877 a={}; nmax=128; %t A342877 Do[If[(Prime[n]-2)/(n-1)>(Prime[n-1]-2)/(n-2),AppendTo[a,1],AppendTo[a,0]],{n,3,nmax}]; %t A342877 a %t A342877 (* Uncomment and run next lines to produce the log-linear plot available in Links *) %t A342877 (* a={}; %t A342877 nmax=2^18; %t A342877 Do[If[(Prime[n]-2)/(n-1)>(Prime[n-1]-2)/(n-2),AppendTo[a,{n,1}],AppendTo[a,{n,0}]],{n,3,nmax}]; %t A342877 ListLogLinearPlot[Transpose[{Range[3,nmax],Accumulate[Transpose[a][[2]]]/Range[3,nmax]}],Frame->True,PlotRange->{All,{0.25,0.75}},PlotLabel->Text[Style["Sum_{i=1..n} a(i)/n",FontSize->16]], %t A342877 FrameLabel->{Text[Style["n",FontSize->16]],},PlotStyle->{PointSize->Small,Red},GridLines->Automatic] *) %o A342877 (PARI) A342877(n) = (((prime(n)-2)/(n-1)) > ((prime(n-1)-2)/(n-2))); \\ _Antti Karttunen_, Mar 28 2021 %Y A342877 Cf. A001223, A079418, A286888. %K A342877 nonn %O A342877 3,1 %A A342877 _Andres Cicuttin_, Mar 28 2021