OFFSET
1,2
COMMENTS
In other words, if the squarefree kernel of a(n-1) is a primorial term then a(n) is the least novel multiple of the smallest prime which does not divide a(n-1). Otherwise a(n) is the least novel multiple of the product of all primes < gpd(a(n-1)) which do not divide a(n-1). Primes >= 5 arrive late (as least unused term), and a(k) is prime(m) iff a(k-1) is A002110(m-1). The pattern around a prime is P(k), prime(k+1), 2*P(k), m*prime(k+1) for some multiplier m, where P(k) = A002110(k). The sequence is conjectured to be a permutation of the positive integers, with primes in natural order.
A common mode in this sequence is alternation of squarefree semiprime q(j)*q(k), j < k, followed by P(k-1)/q(j). The alternation often occurs in runs such that each iteration increments k. Example: a(241..246): q(2)*q(17) -> P(16)/q(2) -> q(2)*q(18) -> P(17)/q(2) -> q(2)*q(19) -> P(18)/q(2). a(16539..16572) represents a run of 17 alternations. - Michael De Vlieger, Jul 17 2023
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^16, highlighting prime a(n) in red.
EXAMPLE
a(5) = 6 a primorial number so the next term is the smallest prime not dividing 6, thus a(7) = 5.
a(26) = 33 = 3*11 and the product of primes < 11 which do not divide 11 is 2*5*7 = 70, which has not occurred previously, therefore a(27) = 70.
MATHEMATICA
nn = 120; c[_] := False; m[_] := 1; a[1] = j = 1; c[1] = True;
f[x_] := If[# == Prime@ Range[PrimePi@ #[[-1]]], Prime[PrimePi@ #[[-1]] + 1],
Times @@ Complement[Prime@ Range[PrimePi@ #[[-1]] - 1], #]] &[
FactorInteger[x][[All, 1]]];
Do[While[Set[k, f[j]]; c[k m[k]], m[k]++]; k *= m[k];
Set[{a[n], c[k], j}, {k, True, k}], {n, 2, nn}];
Array[a, nn] (* Michael De Vlieger, Jul 17 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jul 15 2023
EXTENSIONS
More terms from Michael De Vlieger, Jul 17 2023
STATUS
approved