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.

Original entry on oeis.org

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

Views

Author

Carl R. White, Jul 27 2024

Keywords

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

Crossrefs

Programs

  • 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 *)
  • 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