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(n) = index of the first occurrence of n in A087565, or 0 if n is not a term of A087565.
1

%I #4 Dec 05 2013 19:56:31

%S 1,3,9,0,7,26,32,35,29,11,109,31,95,43,394,67,127,23,55,224,107,265,

%T 237,92,158,386,233,989,401,1229,714,197,380,384,541,142,179,376,908,

%U 149,723,963,169,2187,909,919,519,360,674,1376,636,643,2468,1284,504,781

%N a(n) = index of the first occurrence of n in A087565, or 0 if n is not a term of A087565.

%C Smallest k such that n is the smallest number for which k*(k+1)*(k+2)...(k+n) + 1 is prime.

%C a(3) = 0 since 3 is not a term of A087565 because k*(k+1)*(k+2)*(k+3) + 1 is a square for every k.

%e a(1) = 3 since 1+1 is prime, 2+1 is prime, 3+1 is composite, 3*(3+1)+1 = 13 is prime.

%o (PARI) {p=55; a=2500; v=vector(p+1); for(n=1,a,k=0; m=n; while(!isprime(m+1,1)&& k<=p+1,k++; m=m*(n+k)); if(k<=p,if(v[k+1]<1,v[k+1]=n))); for(j=1,p+1,print1(v[j],","))}

%Y Cf. A087564, A087565.

%K nonn

%O 0,2

%A _Amarnath Murthy_, Sep 15 2003

%E Edited and extended by _Klaus Brockhaus_, Sep 20 2003