%I #14 May 25 2024 15:42:21
%S 1,2,3,4,5,6,7,10,9,8,11,14,15,12,13,22,21,20,18,17,26,33,28,25,24,19,
%T 34,39,44,35,30,23,38,51,52,55,42,40,27,16,29,46,57,68,65,66,49,45,36,
%U 31,58,69,76,85,78,77,56,50,48,37,62,87,92,95,102,91,88,63
%N a(1) = 1. Thereafter, if A007947(a(n-1)) is a term in A002110, a(n) is the smallest prime not already in the sequence. Otherwise a(n) is the smallest novel multiple of p, the greatest prime < g = gpd(a(n-1)).
%C In other words, if the squarefree kernel (radical) of a(n-1) is a primorial number, a(n) is the smallest prime which is not already a term. Otherwise a(n) is the smallest novel multiple of the greatest prime p < g = gpd(a(n-1)). Initially, the arrival of a prime term p > 2 produces a run of multiples (m(q)) of primes q < p with q decrementing as n increases, until reaching a term whose kernel is a primorial number, whereupon the next prime comes in and the process is repeated.
%C A term whose radical is in A002110 occurs only if the multiplier m (of prime q) is in A002110, either with q|m, or with q the smallest prime > gpd(m). Thus all multiples of every prime will appear and it is therefore conjectured that this sequence is a permutation of the positive integers, A000027.
%C The only route to a power of 2 in the sequence is if no prime q < p, and its associated multiplier m(q) in the descending order of multiples provoked by a higher prime produces a primorial kernel. In such cases a power of 2 is only possible if preceded by a power of 3. Powers of 2 occur later and later as the sequence extends.
%C Whereas it seems obvious that a prime can only appear consequent to a primorial kernel, this is not always the case (see Example). Despite this it appears that primes arriving from the second part of the definition do not disturb the natural order of primes in the sequence (a prime from the second part of the definition is the one expected by the first).
%C See notes link for basic description of tipping point behavior in this sequence between n = 114767..171742, associated with gpf(m) > p, conspicuous in scatterplot. The sequence seems to be permanently transformed after n = 3406825.
%H Michael De Vlieger, <a href="/A372368/b372368.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael De Vlieger, <a href="/A372368/a372368.png">Log log scatterplot of a(n)</a>, n = 1..3600000.
%H Michael De Vlieger, <a href="/A372368/a372368_1.png">Log log scatterplot of a(n)</a>, n = 1..120000, showing primes in red, perfect prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue and purple, where purple shows powerful numbers that are not prime powers.
%H Michael De Vlieger, <a href="/A372368/a372368.txt">Notes on this sequence</a>.
%e rad(a(1)) = rad(1) = 1 = A002110(0), hence a(2) = 2, the smallest novel prime.
%e rad(a(2)) = rad(2) = 2 = A002110(1), so a(3) = 3, the smallest novel prime.
%e a(3) = 3 is not a term in A002110 so a(4) = 4, the least novel multiple of p = 2.
%e rad(a(4)) = rad(4) = 2 = A002110(1), so a(5) = next novel prime = 5.
%e Define condition [A] to be the entry of smallest missing prime given primorial rad(a(n-1)), and define condition [B] to be the entry of a(n) = m * p.
%e The following illustrates the cycle following a(32) = prime(9) = 23. This cycle is "full", ending with a power of 2. We mark condition [A] in the last column, all unmarked terms come about through condition [B].
%e prime factors
%e n a(n) 2 3 5 7 11 13 17 19 23 29 m g
%e -----------------------------------------------
%e 32 23 . . . . . . . . 1 (1) 23 [A]
%e 33 38 1 . . . . . . 1 2 19
%e 34 51 . 1 . . . . 1 3 17
%e 35 52 2 . . . . 1 4 13
%e 36 55 . . 1 . 1 5 11
%e 37 42 1 1 . 1 6 7
%e 38 40 3 . 1 8 5
%e 39 27 . 3 9 3
%e 40 16 4 8 2
%e 41 29 . . . . . . . . . 1 (1) 29 [A]
%e a(41) = 29 since rad(a(40)) = rad(16) = 2 = A002110(1).Earliest example of a prime that comes in through condition [B]:
%e prime factors
%e n a(n) 2 3 5 7 11 13 17 19 ~ 313 317 331 m g
%e ------------------------------------------------------------
%e 3473 2850 1 1 2 . . . . 1 150 19
%e 3474 2805 . 1 1 . 1 . 1 165 17
%e 3475 2730 1 1 1 1 . 1 210 13
%e 3476 2695 . . 1 2 1 245 11
%e 3477 2317 . . . 1 . . . . ~ . . 1 331 7
%e 3478 317 . . . . . . . . ~ . 1 1 317
%e 3479 1252 2 . . . . . . . ~ 1 4 313
%e a(3496) = 2695 = 5*7^2*11, which is not in A002110, so a(3497) = smallest novel multiple of 7 = m*7 for m = 331 (prime). Thus a(3497) = 7*331 = 2317. This implies a(3498) = m*317 for m = 1 (since 317 is the greatest prime < 331). Condition [B] becomes the most frequent source of primes in the sequence as n increases.
%t nn = 1000; c[_] := False; m[_] := 1; P = FoldList[Times, 1, Prime@ Range[120]];
%t a[1] = j = 1; c[1] = True; v = 2;
%t Monitor[Do[
%t If[MemberQ[P, Times @@ #[[All, 1]]],
%t k = v,
%t While[c[Set[k, # m[#]]], m[#]++] &[
%t Prime[PrimePi[#[[-1, 1]] ] - 1] ] ] &[FactorInteger[j]];
%t Set[{a[n], c[k], j}, {k, True, k}];
%t If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}], n];
%t Array[a, nn]
%Y Cf. A002110, A007947, A055932.
%K nonn
%O 1,2
%A _David James Sycamore_ and _Michael De Vlieger_ Apr 28 2024