OFFSET
1,1
COMMENTS
Analogous to the Fortunate numbers, but unlike them, not all terms here are prime. Many odd-indexed terms are powers of two and all even-indexed terms are prime.
MATHEMATICA
NextPrime[ n_Integer ] := (k=n+1; While[ !PrimeQ[ k ], k++ ]; Return[ k ]); f[ n_Integer ] := (p = n!! + 1; q = NextPrime[ p ]; Return[ q - p + 1 ]); Table[ f[ n ], {n, 1, 75} ]
dfnp[n_]:=Module[{df=n!!}, NextPrime[df+1]-df]; Array[dfnp, 80] (* Harvey P. Dale, Mar 25 2012 *)
PROG
(MuPAD) for n from 1 to 72 do f := n!!:a := nextprime(f+2)-f:print(a) end_for; // Zerinvary Lajos, Feb 22 2007
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Sep 09 2000
STATUS
approved