login
A375009
a(n) = smallest prime Q of a consecutive prime triple {P, Q, R} such that floor( (R-Q) * (Q-P) / 8 ) = n.
1
7, 139, 23, 53, 1151, 89, 113, 10007, 509, 331, 91079, 479, 541, 79699, 631, 1129, 293, 211, 5557, 265621, 2633, 1259, 1599709, 3659, 1327, 2127269, 4703, 1847, 1349533, 4201, 7621, 16519, 2579, 41333, 10343761, 4621, 4327, 8039, 16729, 3433, 166209301, 3271, 44351
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
Sequence in context: A120052 A171106 A217504 * A142295 A056254 A137463
KEYWORD
nonn
AUTHOR
Carl R. White, Jul 27 2024
STATUS
approved