login
A339316
a(1) = 2; for n > 1, a(n) = smallest composite number not occurring earlier which does not share a factor with a(n-1).
1
2, 9, 4, 15, 8, 21, 10, 27, 14, 25, 6, 35, 12, 49, 16, 33, 20, 39, 22, 45, 26, 51, 28, 55, 18, 65, 24, 77, 30, 91, 32, 57, 34, 63, 38, 69, 40, 81, 44, 75, 46, 85, 36, 95, 42, 115, 48, 119, 50, 87, 52, 93, 56, 99, 58, 105, 62, 111, 64, 117, 68, 121, 54, 125, 66, 133, 60, 143, 70, 123, 74, 129
OFFSET
1,1
COMMENTS
The sequence excludes primes as otherwise the terms would simply be all the ordered integers >= 2. The terms appear to cluster around two lines; the lower line is a(n) ~ n while the upper lines starts with a gradient of approximately 2 and then slowly flattens. It is possible this gradient approaches 1 as n->infinity.
LINKS
EXAMPLE
a(2) = 9, as a(1) = 2 thus a(2) cannot contain 2 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 9.
a(3) = 4, as a(2) = 9 and thus a(3) cannot contain 3 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 4.
a(4) = 15, as a(3) = 4 and thus a(4) cannot contain 2 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 15.
PROG
(PARI) isok(k, fprec, v) = {if (!isprime(k) && #select(x->(x==k), v) == 0, #setintersect(Set(factor(k)[, 1]), fprec) == 0; ); }
lista(nn) = {my(va= vector(nn)); va[1] = 2; for (n=2, nn, my(k=2, fprec = Set(factor(va[n-1])[, 1])); while (! isok(k, fprec, va), k++); va[n] = k; ); va; } \\ Michel Marcus, Nov 30 2020
(Python)
from sympy import isprime, primefactors as pf
def aupton(terms):
alst, aset = [2], {2}
for n in range(2, terms+1):
m, prevpf = 4, set(pf(alst[-1]))
while m in aset or isprime(m) or set(pf(m)) & prevpf != set(): m += 1
alst.append(m); aset.add(m)
return alst
print(aupton(72)) # Michael S. Branicky, Feb 09 2021
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Nov 30 2020
STATUS
approved