cp's OEIS Frontend

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.

A375009 a(n) = smallest prime Q of a consecutive prime triple {P, Q, R} such that floor( (R-Q) * (Q-P) / 8 ) = n.

This page as a plain text file.
%I A375009 #22 Oct 21 2024 14:27:17
%S A375009 7,139,23,53,1151,89,113,10007,509,331,91079,479,541,79699,631,1129,
%T A375009 293,211,5557,265621,2633,1259,1599709,3659,1327,2127269,4703,1847,
%U A375009 1349533,4201,7621,16519,2579,41333,10343761,4621,4327,8039,16729,3433,166209301,3271,44351
%N A375009 a(n) = smallest prime Q of a consecutive prime triple {P, Q, R} such that floor( (R-Q) * (Q-P) / 8 ) = n.
%C A375009 Without taking the floor there is no such Q where (R-Q)*(Q-P)/8 = 2.
%C A375009 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
%p A375009 N:= 50: # for a(1) .. a(N)
%p A375009 V:= Vector(N): count:= 0:
%p A375009 q:= 2: r:= 3:
%p A375009 while count < N do
%p A375009   p:= q; q:= r; r:= nextprime(r);
%p A375009   v:= floor((r-q)*(q-p)/8);
%p A375009   if v >= 1 and v <= N and V[v] = 0 then
%p A375009     V[v]:= q; count:= count+1
%p A375009   fi;
%p A375009 od:
%p A375009 convert(V,list); # _Robert Israel_, Sep 24 2024
%t A375009 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 *)
%o A375009 (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
%o A375009 (Python)
%o A375009 from sympy import nextprime
%o A375009 def A375009(n):
%o A375009     p,q = 2,3
%o A375009     while True:
%o A375009         r = nextprime(q)
%o A375009         if (r-q)*(q-p)>>3==n:
%o A375009             return q
%o A375009         p,q = q,r # _Chai Wah Wu_, Oct 21 2024
%Y A375009 Cf. A083550, A001223.
%K A375009 nonn
%O A375009 1,1
%A A375009 _Carl R. White_, Jul 27 2024