login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A083275
a(n) = smallest number not occurring earlier such that a(1)*a(2)*...*a(n) - 1 is prime.
3
3, 1, 2, 4, 7, 5, 6, 11, 12, 10, 13, 17, 14, 16, 15, 8, 18, 23, 21, 26, 22, 27, 41, 30, 20, 57, 32, 29, 24, 65, 42, 38, 28, 63, 35, 19, 58, 31, 36, 61, 45, 37, 33, 69, 53, 67, 127, 40, 95, 25, 86, 48, 39, 72, 70, 79, 54, 74, 91, 125, 85, 94, 46, 9, 80, 60, 119, 167, 139, 90, 49
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