%I #24 Feb 23 2023 15:31:18
%S 1,3,1,5,-1,5,5,7,3,11,5,11,11,13,9,17,11,17,17,19,-1,19,17,17,19,23,
%T 17,29,19,27,25,25,27,31,13,35,35,37,33,41,35,41,41,43,23,43,41,41,43,
%U 47,17,49,47,47,49,53,47,59,49,57,55,55,57
%N a(n) = n - d1*d2, where d1, d2 are the distances from n to the previous and the next prime number respectively.
%C Except for a(7) and a(23) that are negative, it seems that the density of the prime numbers is such that; n is greater than the product d1 * d2 for each n.
%C So I conjecture that n > d1 * d2 for every N - {1, 2, 7, 23}. If it is true, it means that there is at least 1 prime number in the interval [n - sqrt(n), n + sqrt(n)].
%C I also conjecture that lim_{n -> oo} (n - d1*d2)/n = a(n)/n = 1.
%H Robert Israel, <a href="/A334194/b334194.txt">Table of n, a(n) for n = 3..10000</a>
%e For n = 9, a(9) = 9 - (9 - 7) * (11 - 9) = 9 - 2 * 2 = 5, because the previous prime is 7 and the next prime is 11.
%e For n = 23, the previous prime is 19 so d1 = 23 - 19 = 4. The next prime is 29 so d2 = 29 - 23 = 6. The product d1 * d2 = 4 * 6 = 24 (maybe the last time that the product d1 * d2 > n). So a(23) = 23 - 24 = -1.
%p N:= 100: V:= Vector(N):
%p p:= 2: q:= 3:
%p while q <= N do
%p r:= nextprime(q);
%p V[q]:= q - (q-p)*(r-q);
%p for k from q+1 to r-1 do
%p if k > N then break fi;
%p V[k]:= k - (k-q)*(r-k);
%p od;
%p p:= q; q:= r;
%p od:
%p convert(V[3..N],list); # _Robert Israel_, Feb 23 2023
%o (PARI) for(n = 3, 100, d1 = n - precprime(n - 1); d2 = nextprime(n + 1) - n; print1(n - d1*d2", "))
%Y Cf. A000040, A151799, A151800.
%K sign
%O 3,2
%A _Dimitris Valianatos_, Apr 18 2020
%E Edited by _Robert Israel_, Feb 23 2023
|