A036013 a(n) = smallest number > 1 such that a(1)a(2)...a(n) - 1 is prime (or 1).
2, 2, 2, 3, 2, 4, 2, 3, 6, 4, 5, 5, 5, 10, 4, 3, 5, 8, 22, 13, 14, 2, 5, 5, 2, 20, 9, 9, 24, 5, 26, 15, 14, 25, 25, 4, 9, 30, 9, 21, 12, 11, 10, 2, 40, 19, 8, 13, 11, 50, 3, 25, 25, 8, 5, 25, 46, 19, 47, 54, 9, 13, 14, 43, 4, 24, 28, 16, 33, 25, 152, 2, 11, 22, 6, 78, 87, 7, 10, 21
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..1600 (terms 1..300 from T. D. Noe)
Programs
-
Mathematica
sng1[{t_,a_}]:=Module[{k=2},While[CompositeQ[t k-1],k++];{t*k,k}]; NestList[sng1,{2,2},80][[;;,2]] (* Harvey P. Dale, May 20 2023 *)
-
Python
from sympy import isprime from itertools import count a,p = [2],2 for _ in range(100): q = next(filter(lambda x:isprime(x*p-1), count(2))) p = p*q a.append(q) print(a) # Nicholas Stefan Georgescu, Mar 06 2023
Extensions
More terms from Erich Friedman. More terms from Jud McCranie, Jan 26 2000.
Comments