OFFSET
1,1
LINKS
Alois P. Heinz and Giovanni Resta, Table of n, a(n) for n = 1..1200 (first 300 terms from Alois P. Heinz)
MAPLE
b:= proc() false end:
m:= proc(n) option remember; a(n)*m(n-1) end: m(0):=1:
a:= proc(n) option remember; local k; for k while b(k)
or not isprime(k*m(n-1)-1) do od; b(k):=true; k
end:
seq(a(n), n=1..80); # Alois P. Heinz, Jun 17 2015
MATHEMATICA
p=1; L={}; Do[k=1; While[ MemberQ[L, k] || !PrimeQ[p*k - 1], k++]; p *= k; AppendTo[L, k], {30}]; L (* Giovanni Resta, Jun 23 2015 *)
PROG
(PARI) v=[3]; n=1; while(n<100, s=-1+n*prod(i=1, #v, v[i]); if(isprime(s)&&!vecsearch(vecsort(v), n), v=concat(v, n); n=0); n++); v \\ Derek Orr, Jun 16 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Jun 01 2003
EXTENSIONS
Name corrected by Derek Orr, Jun 16 2015
STATUS
approved