OFFSET
0,7
COMMENTS
Any composite a(n) would disprove Fortune's conjecture, see A005235. - Jeppe Stig Nielsen, Oct 31 2003
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Min(1, A005235(n)); a(n)=1 for n=1, 2, 3, 4, 5, 11, 75, ...
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
EXAMPLE
MAPLE
p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
a:= n-> nextprime(p(n))-p(n):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 16 2020
MATHEMATICA
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 *)
PROG
(PARI) a(n) = my(P=vecprod(primes(n))); nextprime(P+1) - P; \\ Michel Marcus, Dec 12 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 02 2000
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Mar 16 2020
STATUS
approved