OFFSET
1,2
EXAMPLE
a(1) = 1 since 1*2^2 - 1 = 3 is prime.
a(2) = 2 since 2*(2*3)^3 - 1 = 431 is prime.
MATHEMATICA
a[n_] := Module[{k = 1, p = Product[Prime[i], {i, 1, n}]^Prime[n]}, While[!PrimeQ[k*p-1], k++]; k]; Array[a, 50] (* Amiram Eldar, Jul 17 2021 *)
PROG
(Python)
from sympy import isprime, prime, primorial
def a(n):
k, t = 1, primorial(n)**prime(n)
while True:
if isprime(k*t - 1): return k
k += 1
print([a(n) for n in range(1, 15)]) # Michael S. Branicky, Jan 29 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Pierre CAMI, Jan 21 2005
EXTENSIONS
a(27)-a(32) from Amiram Eldar, Jul 17 2021
a(33)-a(34) from Michael S. Branicky, Jan 29 2022
a(35)-a(36) from Michael S. Branicky, Feb 03 2022
a(37)-a(42) from Michael S. Branicky, May 14 2023
STATUS
approved