OFFSET
1,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^10, showing primes in red, prime powers in gold, squarefree composites in green, and numbers neuther squarefree nor prime powers in blue and magenta, with magenta additionally representing powerful numbers that are not prime powers.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20.
FORMULA
For prime a(n) = p, a(n+2) = 2*p. - Michael De Vlieger, May 31 2025
EXAMPLE
The lexicographically earliest condition requires that the sequence starts a(n) = n for n <= 3. Then with a(2) = 2 and a(3) = 3 a(4) must be 4, the smallest novel number sharing a prime divisor with 2 (since gcd(2,3) = 1). Since gcd(3,4) = 1, a(5) must be 6, the smallest novel number sharing a prime divisor with 3. Since gcd(4,6) > 1 a(6) = 5, the smallest novel number prime to a(4) = 4. a(8) = 8 because gcd(6,5) = 1 and then a(9) = 2*5 = 10 the smallest novel number sharing a factor with 5.
MATHEMATICA
nn = 120; c[_] := False; m[_] := 1; c[1] = c[2] = c[3] = True; i = 2; j = 3; u = 4;
Range[3]~Join~Reap[Do[
If[CoprimeQ[i, j],
If[PrimePowerQ[i],
p = FactorInteger[i][[1, 1]]; While[c[p*m[p]], m[p]++]; k = p*m[p],
k = u; While[Or[c[k], CoprimeQ[i, k]], k++] ],
k = u; While[Or[c[k], ! CoprimeQ[j, k]], k++] ];
Sow[k]; Set[{c[k], i, j}, {True, j, k}];
If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, May 31 2025 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, May 31 2025
STATUS
approved
