OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..42
EXAMPLE
a(4) = 14 = 2*7, a(4)+1 = 15 = 3*5;
a(5) = 209 = 11*19, a(5)+1 = 210 = 2*3*5*7;
a(6) = 1364 = 2*2*11*31, a(6)+1 = 1365 = 3*5*7*13.
a(6) is not 714 even though 714 * 715 is divisible by the first 6 primes. It is disqualified as it is also a multiple of prime(6+1) = 17. - David A. Corneth, Aug 16 2023
MATHEMATICA
With[{s = Table[k = 1; While[! CoprimeQ[n, n + 1, Set[p, Prime@ k]], k++]; p, {n, 10^6}]}, Flatten@ Table[FirstPosition[s, Prime@ n], {n, 2, PrimePi@ Max@ s}]] (* Michael De Vlieger, Aug 01 2017 *)
PROG
(PARI) a(n) = {my(res = oo, pr = primes(n+1), mp = pr[#pr], mpm1 = mp - 1); v = vector(n, i, [-1, 0]); forvec(x = v, c = lift(chinese(vector(n, i, Mod(x[i], pr[i])))); if(0 < c && c < res, if(c % mp != 0 && c % mp != mpm1, res = c))); res} \\ David A. Corneth, Aug 16 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 23 2010; corrected Jul 27 2010
EXTENSIONS
a(11)-a(19) from Donovan Johnson, Jul 30 2010
More terms from David A. Corneth, Aug 16 2023
STATUS
approved