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) is the smallest m such that A002110(n) + m is prime.
10

%I #33 Dec 12 2023 10:31:39

%S 1,1,1,1,1,1,17,19,23,37,61,1,61,71,47,107,59,61,109,89,103,79,151,

%T 197,101,103,233,223,127,223,191,163,229,643,239,157,167,439,239,199,

%U 191,199,383,233,751,313,773,607,313,383,293,443,331,283,277,271,401,307

%N a(n) is the smallest m such that A002110(n) + m is prime.

%C Any composite a(n) would disprove Fortune's conjecture, see A005235. - _Jeppe Stig Nielsen_, Oct 31 2003

%H Robert G. Wilson v, <a href="/A038711/b038711.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = Min(1, A005235(n)); a(n)=1 for n=1, 2, 3, 4, 5, 11, 75, ...

%F a(n) = 1 for n=0, 1, 2, 3, 4, 5, 11, 75, ... (A014545); a(n) = A005235(n) otherwise. - _Jeppe Stig Nielsen_, Oct 31 2003

%F a(n) = A038710(n) - A002110(n). - _Alois P. Heinz_, Mar 16 2020

%e For n=11, 1 + A002110(11) = 200560490131 < 200560490197 = 67 + A002110(11); therefore, a(11)=1 but A005235(11)=67.

%p p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:

%p a:= n-> nextprime(p(n))-p(n):

%p seq(a(n), n=0..60); # _Alois P. Heinz_, Mar 16 2020

%t nmax=2^16384; npd=1;n=1;npd=npd*Prime[n]; While[npd<nmax, tt=1; cp=npd+tt; While[ !(PrimeQ[cp]), tt=tt+2;cp=cp+2]; Print[tt]; n=n+1; npd=npd*Prime[n]] (* _Lei Zhou_, Feb 15 2005 *)

%o (PARI) a(n) = my(P=vecprod(primes(n))); nextprime(P+1) - P; \\ _Michel Marcus_, Dec 12 2023

%Y Cf. A002110, A005235, A035345, A018239, A038710, A060270.

%K nonn

%O 0,7

%A _Labos Elemer_, May 02 2000

%E a(0)=1 prepended by _Alois P. Heinz_, Mar 16 2020