OFFSET
1,1
COMMENTS
Without taking the floor there is no such Q where (R-Q)*(Q-P)/8 = 2.
Dickson's conjecture implies that if n == 0 or 1 (mod 3) there are infinitely many primes Q such that Q - 2 is the previous prime and Q + 4 n is the next prime, and that if n == 2 (mod 3) there are infinitely many primes Q such that Q - 2 is the previous prime and Q + 4 n + 2 is the next prime. - Robert Israel, Sep 24 2024
MAPLE
N:= 50: # for a(1) .. a(N)
V:= Vector(N): count:= 0:
q:= 2: r:= 3:
while count < N do
p:= q; q:= r; r:= nextprime(r);
v:= floor((r-q)*(q-p)/8);
if v >= 1 and v <= N and V[v] = 0 then
V[v]:= q; count:= count+1
fi;
od:
convert(V, list); # Robert Israel, Sep 24 2024
MATHEMATICA
With[{p = Prime[Range[10^6]]}, r = (Floor[(#[[3]] - #[[2]])*(#[[2]] - #[[1]])/8]) & /@ Partition[p, 3, 1]; p[[1 + TakeWhile[FirstPosition[r, #] & /@ Range[Max[r]], ! MissingQ[#] &] // Flatten]]] (* Amiram Eldar, Sep 24 2024 *)
PROG
(PARI) lista(len) = {my(c = 0, v = vector(len), p1 = 2, p2 = 3, i); forprime(p3 = 5, , i = floor((p3-p2)*(p2-p1)/8); if(i > 0 && i <= len && v[i] == 0, c++; v[i] = p2; if(c==len, break)); p1 = p2; p2 = p3); v; } \\ Amiram Eldar, Sep 24 2024
(Python)
from sympy import nextprime
def A375009(n):
p, q = 2, 3
while True:
r = nextprime(q)
if (r-q)*(q-p)>>3==n:
return q
p, q = q, r # Chai Wah Wu, Oct 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl R. White, Jul 27 2024
STATUS
approved