OFFSET
1,1
COMMENTS
Conjecture: a(n) > 1.
EXAMPLE
5*2+2-1=11 is a prime, therefore a(3)=2.
7*2+2-1=15 is not a prime, but 7*3+3-1=23 is a prime, so a(4)=3.
MATHEMATICA
lx[n_]:=Module[{x=2, p=Prime[n]}, While[!PrimeQ[p*x+x-1], x++]; x]; Array[ lx, 90] (* Harvey P. Dale, Jul 18 2020 *)
PROG
(Python)
from sympy import isprime
TOP=1000000
for p in range(2, 777):
if isprime(p):
failed = True
for x in range(2, TOP):
if isprime(p*x+x-1):
print str(x)+', ',
failed = False
break
if failed: print '-1, ',
(PARI) a(n) = {my(x = 2); while (!isprime(prime(n)*x+x-1), x++); x; } \\ Michel Marcus, Dec 27 2015; corrected Jun 13 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Dec 24 2015
STATUS
approved