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.

A348348 Smallest k such that the numbers j*k - 1 and j*k + 1 are prime for 1 <= j <= n.

This page as a plain text file.
%I A348348 #31 Jul 01 2022 06:25:50
%S A348348 4,6,6,21968100,100803789240,683751016938990,1651735848676253340
%N A348348 Smallest k such that the numbers j*k - 1 and j*k + 1 are prime for 1 <= j <= n.
%C A348348 The following heuristic argument suggests that a(n) exists for all n: For large (random) k and a specific j <= n, the probability that both j*k - 1 and j*k + 1 are prime should be of the order 1/(log k)^2 (a slight twist of the first Hardy-Littlewood conjecture). Assuming independence between different j, the probability that this holds for 1 <= j <= n is of the order 1/(log k)^(2*n). Since the sum over k of 1/(log k)^(2*n) diverges, this should hold for infinitely many k by the second Borel-Cantelli lemma (assuming independence between different k).
%H A348348 Wikipedia, <a href="https://en.wikipedia.org/wiki/Borel-Cantelli_lemma">Borel-Cantelli lemma</a>
%H A348348 Wikipedia, <a href="https://en.wikipedia.org/wiki/Twin_prime">Twin prime</a>
%e A348348 a(1) = A014574(1) = 4.
%e A348348 a(2) = A066388(1) = 6.
%e A348348 a(3) = A118859(1) = 6.
%e A348348 a(4) = A118860(1) = 21968100.
%e A348348 a(5) = A349321(1) = 100803789240.
%o A348348 (Python)
%o A348348 from sympy import isprime,nextprime
%o A348348 def A348348(n):
%o A348348     p = 2
%o A348348     while 1:
%o A348348         p_next = nextprime(p)
%o A348348         if p_next == p+2 and all(isprime(j*(p+1)-1) and isprime(j*(p+1)+1) for j in range(2,n+1)):
%o A348348             return p+1
%o A348348         p = p_next
%o A348348 (PARI) isok(k, n) = for (j=1, n, if (!isprime(j*k-1) || !isprime(j*k+1), return(0))); return(1);
%o A348348 a(n) = my(k=1); while (!isok(k, n), k++); k; \\ _Michel Marcus_, Jul 01 2022
%Y A348348 Cf. A014574, A066388, A118859, A118860, A349321.
%K A348348 nonn,more
%O A348348 1,1
%A A348348 _Pontus von Brömssen_, Oct 13 2021
%E A348348 a(5), a(6) from _Jon E. Schoenfield_, Nov 14 2021
%E A348348 a(7) from _Klaus Muuss_, Jul 01 2022