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.

A306400 For the n-th prime p of the form 6k-1, a(n) is the first prime q for which (p+q^2-1, p+q^2+1) is a twin prime pair.

This page as a plain text file.
%I A306400 #38 Nov 23 2020 17:07:14
%S A306400 5,7,5,7,11,23,5,7,7,11,5,7,7,11,5,7,701,7,5,5,7,7,41,11,7,19,13,5,7,
%T A306400 31,17,13,11,31,41,13,31,7,29,11,37,13,53,11,19,19,11,13,23,37,7,41,
%U A306400 23,7,29,5,71,5,13,29,13,13,59,97,11,37,17,7,7,5,7,157
%N A306400 For the n-th prime p of the form 6k-1, a(n) is the first prime q for which (p+q^2-1, p+q^2+1) is a twin prime pair.
%C A306400 Actually, there is no need to test for q=2 and q=3, as 6k-1+4+-1 = (6k+2, 6k+4), both terms not prime; and 6k-1+9+-1 = (6k+7,6k+9), with 6k+9 not prime.
%C A306400 The sequence could be extended to nonprime numbers p=6k-1 and/or nonprime numbers q=6t+-1. However, it could not be extended to p=6k+1 (prime or not), because for q=6t+-1, p+q^2 = 6k+1+36t^2+-12t+1 ≡ 2 (mod 6); hence p+q^2+1 == 3 (mod 6) is never a prime number.
%C A306400 Proving that this sequence is infinite would prove the twin prime conjecture (that there are infinitely many twin primes), as the twin prime pair associated with the prime p is greater than p and there are infinitely many prime numbers.
%C A306400 This sequence refers to the first q for which p+q^2+-1 is a twin prime pair. However, analysis (by computer program) suggests that for each prime p there are infinitely many primes q for which p+q^2+-1 is a twin prime pair. Proving this statement, even for a single prime p, would prove the twin prime conjecture.
%H A306400 Robert Israel, <a href="/A306400/b306400.txt">Table of n, a(n) for n = 1..10000</a>
%e A306400 Example: for n=5, a(5) = 11, because the 5th prime of the form 6k-1 is 29, and 29+11^2+-1 = (149,151) is a twin prime pair, while 29+2^2+-1, 29+3^2+-1, 29+5^2+-1, 29+7^2+-1 are not twin prime pairs.
%p A306400 g:= proc(p) local q;
%p A306400   q:= 3:
%p A306400   do
%p A306400     q:= nextprime(q);
%p A306400     if isprime(p+q^2-1) and isprime(p+q^2+1) then return q fi;
%p A306400   od
%p A306400 end proc:
%p A306400 map(g, select(isprime, [seq(i,i=5..1000,6)])); # _Robert Israel_, Nov 23 2020
%t A306400 Table[Block[{q = 2}, While[! AllTrue[p + q^2 + {-1, 1}, PrimeQ], q = NextPrime@ q]; q], {p, Select[Range[5, 825, 6], PrimeQ]}] (* _Michael De Vlieger_, Mar 31 2019 *)
%o A306400 (PARI) lista(nn) = {forprime(p=2, nn, if (((p+1) % 6) == 0, my(q=5); while (!(isprime(p+q^2-1) && isprime(p+q^2+1)), q = nextprime(q+1)); print1(q, ", ");););} \\ _Michel Marcus_, Mar 26 2019
%Y A306400 Cf. A007528, A001359 (lesser of twin primes).
%K A306400 nonn,easy
%O A306400 1,1
%A A306400 _Paolo Iachia_, Mar 25 2019