A096100 a(1) = 1; for n > 1: a(n) = smallest number >1 such that product of any two or more successive terms + 1 is prime.
1, 2, 2, 3, 6, 46, 1306, 7695, 17383720, 2183805400, 60512359083, 447808566362, 181830203704703
Offset: 1
Examples
a(4) is not 2 since 2*2*2 + 1 = 9 is composite, but 2*3 + 1 = 7, 2*2*3 + 1 = 13, 1*2*2*3 + 1 = 13 are all prime, hence a(4) = 3.
Programs
-
PARI
A096100(n, show=0, a=[1])={for(n=1, n-1, show&&print1(a[n]", "); for(k=2, 9e9, my(p=1); for(i=0,n-1,isprime(1+k*p*=a[n-i])||next(2)); a=concat(a,k); break)); a[n]} \\ Use 2nd or 3rd optional arg to print intermediate terms or to use other starting value(s) of the sequence. Not efficient enough to go beyond a(8). - M. F. Hasler, Nov 24 2015
Extensions
Edited, corrected and extended by Klaus Brockhaus, Jul 05 2004
a(10) from Donovan Johnson, Apr 22 2008
a(11)-a(13) from Don Reble, Nov 22 2015
Comments