login
A119323
a(n) is the least prime p such that n*p#-1 is prime.
3
3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 7, 2, 5, 3, 2, 2, 3, 3, 2, 5, 2, 2, 3, 2, 3, 29, 2, 3, 3, 2, 2, 3, 3, 2, 5, 2, 2, 3, 3, 2, 5, 2, 3, 3, 2, 17, 3, 5, 2, 5, 2, 2, 3, 2, 2, 13, 2, 3, 3, 3, 7, 13, 5, 2, 3, 2, 3, 5, 2, 2, 5, 3, 7, 3, 2, 2, 3, 3, 2, 3, 13, 2, 19, 2, 3, 5, 2, 11, 11, 2, 2, 7, 3, 3, 3, 2, 2, 3, 2, 2, 19, 7
OFFSET
1,1
LINKS
EXAMPLE
1*(2*3)-1 = 5 is prime, so a(1) = 3 as 3# = 2*3.
2*(2)-1 = 3 is prime, so a(2) = 2 as 2# = 2.
MATHEMATICA
a[n_] := Module[{p = pr = 2}, While[!PrimeQ[pr * n - 1], p = NextPrime[p]; pr *= p]; p]; Array[a, 100] (* Amiram Eldar, Sep 11 2021 *)
PROG
(PARI) a(n) = {my(k = 1); while (!isprime(n*prod(j=1, k, prime(j)) - 1), k++); prime(k); } \\ Michel Marcus, Sep 14 2019
CROSSREFS
Cf. A002110 (primorials), A119324.
Sequence in context: A127599 A207384 A085034 * A102299 A302481 A306542
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, May 14 2006
EXTENSIONS
More terms from David Wasserman, Jun 20 2007
STATUS
approved