OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..350
FORMULA
log a(n) << n log n. - Charles R Greathouse IV, Jun 20 2015
EXAMPLE
a(5) = 788 as 788, 789, 790, 791 and 792 are divisible by 2, 3, 5, 7, and 11 respectively.
MATHEMATICA
f[n_] := ChineseRemainder[-Range[0, n - 1], Prime[Range[n]]]; Array[f, 17, 2] (* Robert G. Wilson v, Jan 13 2012 *)
(* This code uses memoization in calculating the coeff for the primorial assoc'ed with a(n) value to generate a(n+1), producing 1000 terms in under one second (on a 2017 Costco Dell 64-bit Windows 10 machine)*)
q[1] =0; q[2] =0;
q[n_]:= (ModularInverse[Product[Prime[i], {i, 1, n-1}], Prime[n]] * Mod[Prime[n]-n+1-g[n-1], Prime[n]]) // Mod[#, Prime[n]]&;
g[1] =2; g[2] =2;
g[r_] :=g[r]= g[r-1] + q[r] * Product[Prime[i], {i, 1, r-1}];
Array[g, 1000]
(* Christopher Lamb, Oct 19 2021 *)
PROG
(PARI) a(n)=lift(chinese(vector(max(n, 2), k, Mod(1-k, prime(k))))) \\ Charles R Greathouse IV, Jun 20 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 22 2002
EXTENSIONS
More terms to a(15) from Sascha Kurz, Mar 23 2002
Edited and extended by Robert G. Wilson v, Aug 09 2002
STATUS
approved