OFFSET
1,2
COMMENTS
In other words: j in A002110 implies a(n) = p, next missing prime; j not in A002110 implies a(n) = m*rad(j), with minimal novel m.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of log_10 a(n), n = 1..2^17.
EXAMPLE
MATHEMATICA
{{1, 2, 3, 6}}~Join~Table[Prime[m + 2]*If[n == 0, 1, Product[Prime[i], {i, n}]]*k, {m, 10}, {n, 0, m}, {k, 1 + Boole[n > 1], If[n == 0, 1, Prime[n + 1]]}] // Flatten
(* faster for large datasets, or *)
nn = 1000; c[_] := False; m[_] := 1; f[x_] := FactorInteger[x][[All, 1]]; Array[Set[{a[#], c[#], m[#]}, {#, True, 2}] &, 2]; j = 2; u = v = 3;
Do[If[Or[IntegerQ@ Log2[j],
And[EvenQ[j], Union@ Differences@ PrimePi[#] == {1}] ],
k = v, k = Times @@ #;
While[c[k m[k]], m[k]++]; k *= m[k]] &[f[j]];
Set[{a[n], c[k], j}, {k, True, k}];
If[k == u, While[c[u], u++]];
If[k == v, While[c[v], v = NextPrime[v] ] ], {n, 3, nn}];
Array[a, nn] (* Michael De Vlieger, Nov 04 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Nov 03 2024
STATUS
approved