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!)
A354585 Least prime p such that 2^x - 2 + p produces primes for x=1..n and a composite for x=n+1. 1
2, 3, 11, 5, 227, 17, 65837, 1607, 19427, 2397347207, 153535525937, 157542769194527, 29503289812427, 32467505340816977, 1109038455070356527, 143924005810811657, 305948728878647722727 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
This sequence is a variation of A164926.
a(15) > 10^18. - Bert Dobbelaere, Aug 28 2022
LINKS
EXAMPLE
For n=5, 227 is the smallest prime such that 2^x - 2 + p produces primes for x=1..n and a composite for x=n+1. The following are the 5 primes that are produced: 227, 229, 233, 241, 257; note that the consecutive differences are 2, 4, 8, and 16.
For n=6, 17 is the smallest prime such that 2^x - 2 + p produces primes for x=1..n and a composite for x=n+1. The following are the 6 primes that are produced: 17, 19, 23, 31, 47, 79; note that the consecutive differences are 2, 4, 8, 16, and 32.
PROG
(Python)
import sympy
def get_longest_run_of_primes(p):
run = [p]
x = 2
while True:
next_prime = 2**x - 2 + p
if sympy.isprime(next_prime):
run.append(next_prime)
x = x + 1
else:
break
return run
n_to_longest_run_map = {}
max_prime_index = 100000
for prime_index in range(1, max_prime_index+1):
p = sympy.prime(prime_index)
longest_run_for_p = get_longest_run_of_primes(p)
length_of_longest_run_for_p = len(longest_run_for_p)
if length_of_longest_run_for_p not in n_to_longest_run_map:
n_to_longest_run_map[length_of_longest_run_for_p] = longest_run_for_p
n = 1
seq = []
while n in n_to_longest_run_map:
seq.append(n_to_longest_run_map[n][0])
n = n + 1
print(seq)
CROSSREFS
Cf. A164926.
Sequence in context: A292473 A269253 A084047 * A282770 A145077 A127376
KEYWORD
nonn,hard,more
AUTHOR
Robert C. Lyons, Aug 18 2022
EXTENSIONS
a(10)-a(14), a(16) from Bert Dobbelaere, Aug 28 2022
a(15) from Norman Luhn, Dec 15 2022
a(17) from Norman Luhn, Dec 17 2022
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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)