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”).

a(1) = 3; for n>3, a(n) = smallest number > a(n-1) such that a(1)*a(2)*...*a(n) + 1 is nonprime.
2

%I #9 Jun 19 2019 02:45:06

%S 3,5,6,8,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,

%T 31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,

%U 55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73

%N a(1) = 3; for n>3, a(n) = smallest number > a(n-1) such that a(1)*a(2)*...*a(n) + 1 is nonprime.

%C The numbers 1, 2, 4, 7, 9, 11, 32, 322, 498, 685, 880, ... are not in the sequence.

%H Robert Israel, <a href="/A233746/b233746.txt">Table of n, a(n) for n = 1..2000</a>

%e 3+1 = 4, 3*5+1 = 16, 3*5*6+1 = 91, 3*5*6*8+1 = 721, etc. are nonprimes.

%p A[1]:= 3: P:= 3:

%p for n from 2 to 100 do

%p for k from A[n-1]+1 do

%p if not isprime(P*k+1) then

%p A[n]:= k; P:= P*k; break

%p fi

%p od od:

%p seq(A[i],i=1..100); # _Robert Israel_, Jun 18 2019

%t seq={3};Do[n=Last[seq]+1;While[PrimeQ[n Times@@seq+1],n++];AppendTo[seq,n];,{100}];seq

%Y Cf. A083769, A233745.

%K nonn

%O 1,1

%A _Michel Lagneau_, Dec 15 2013