OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
FORMULA
If p <= n < q, where p and q are consecutive primes, then a(n) = 2p-n, unless n=10. Sketch of proof: a(n) >= 2p-n, to make (n+1)...(n+a(n)) divisible by p. If r is a prime less than p and r does not divide (n+1)...(2p), then r > 2p-n and 2r <= n, so 4p < 3n < 3q. But q/p is known to be < 4/3 for all primes p >= 11.
EXAMPLE
a(6) = 4 as (6+1)*(6+2)*(6+3)*(6+4) is divisible by 2*3*5 but (6+1)*(6+2)*(6+3) is not.
MATHEMATICA
a[n_] := Module[{div, k, pr}, div=Times@@Prime/@Range[PrimePi[n]]; For[k=0; pr=1, True, k++; pr*=n+k, If[Mod[pr, div]==0, Return[k]]]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Sep 20 2002
EXTENSIONS
Edited by Dean Hickerson, Oct 28 2002
STATUS
approved