login
A387832
a(1) = 4, for n > 1, a(n) = largest composite k < a(n-1), a(m) != k, m < n, such that gcd(k, a(n-1)) > 1; if no such k exists, then a(n) = smallest composite k > a(n-1), a(m) != k, m < n, such that gcd(k, a(n-1)) > 1.
1
4, 6, 8, 10, 12, 9, 15, 18, 16, 14, 20, 22, 24, 21, 27, 30, 28, 26, 32, 34, 36, 33, 39, 42, 40, 38, 44, 46, 48, 45, 35, 25, 50, 52, 54, 51, 57, 60, 58, 56, 49, 63, 66, 64, 62, 68, 70, 65, 55, 75, 72, 69, 78, 76, 74, 80, 82, 84, 81, 87, 90, 88, 86, 92, 94, 96, 93
OFFSET
1,1
COMMENTS
Composite version of A386482.
Analogous to A240024 which instead regards the EKG sequence A064413 without the empty product. This sequence comes into and out of agreement with A240024 (ignoring its first term).
Given 2^16 terms, the sole occasion of a(n) | a(n+1) appears to be for n = 32, as 25 | 50. The version of this sequence prohibiting a(n) | a(n+1) appears to differ from this sequence for n = 33..50.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, showing prime powers in gold, squarefree numbers in green, and numbers neither squarefree nor prime powers in blue or magenta, where magenta represents a powerful number that is not a prime power.
EXAMPLE
a(2) = 6 since 4 is the smallest composite number, and 6 is the smallest number not coprime to 4.
a(3) = 8 since there are no composite numbers available that are less than 6, but 8 is the smallest number that is not coprime to 6.
a(4) = 10 since there are no composite numbers available smaller than 8, and 8 and 9 are coprime.
a(5) = 12 since 9 is coprime to 10.
a(6) = 9 since 9 < 12, and 9 and 12 share the factor 3.
a(7) = 15 since there are no smaller composite numbers available, and 14 is coprime to 9.
a(8) = 18 since 14 and 16, respectively, are coprime to 15.
a(9) = 16 since it is the largest composite smaller than 18 that is not coprime to 18. A240024 has 14 follow 18 because 14 is smaller than 16 and thus satisfies the definition of A240024, etc.
MATHEMATICA
Block[{c, j, k, s, nn},
nn = 120; s = {4, 6}; c[_] := False; j = s[[-1]]; Map[Set[c[#], True] &, s];
s~Join~Reap[Do[k = j - 1;
While[And[Or[c[k], PrimeQ[k], CoprimeQ[j, k]], k != 1], k--];
If[k == 1, k += j; While[Or[c[k], PrimeQ[k], CoprimeQ[j, k]], k++]];
Set[{c[k], j}, {True, Sow[k]}], {n, Length[s] + 1, nn}] ][[-1, 1]] ]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Sep 09 2025
STATUS
approved