The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A357746 Primes p such that the least k for which k*p + 1 is prime is also the least k for which k*p - 1 is prime. 1
47, 103, 107, 283, 313, 347, 397, 773, 787, 907, 1051, 1117, 1319, 1433, 1823, 2027, 2153, 2203, 2287, 2333, 2347, 2381, 2909, 3221, 3257, 3673, 3923, 3929, 4129, 4153, 4217, 4547, 4597, 4657, 4721, 4969, 5023, 5387, 5407, 5693, 5717, 5827, 5881, 6373, 6781, 6863, 6997 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If A035096(n) = A216568(n) the n-th prime is a term. Here k*p must be the composite number sandwiched between a pair of twin primes, so by Wilson's theorem, k must be a multiple of 6.
LINKS
Wikipedia, Wilson's theorem.
EXAMPLE
a(1) = 47: 47*6 + 1 = 283 (a prime), 47*6 - 1 = 281 (also a prime), and no k < 6 gives a prime as the result for both formulas.
MATHEMATICA
q[p_] := Module[{k = 1, r}, While[! Or @@ (r = PrimeQ[k*p + {-1, 1}]), k++]; And @@ r]; Select[Prime[Range[900]], q] (* Amiram Eldar, Jan 01 2023 *)
PROG
(Python)
from sympy import sieve, isprime
def leastk(p, plusminus):
k=1
while not isprime(k * p + plusminus): k += 1
return k
print([p for p in sieve[1:1000] if leastk(p, 1) == leastk(p, -1)])
(PARI) isk(p, x) = my(k=1); while (!isprime(k*p+x), k++); k;
isok(p) = if (isprime(p), isk(p, +1) == isk(p, -1)); \\ Michel Marcus, Jan 01 2023
CROSSREFS
Sequence in context: A245688 A211331 A141961 * A142661 A216067 A124096
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Jan 01 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 10 06:18 EDT 2024. Contains 373253 sequences. (Running on oeis4.)