login
Lexicographically earliest infinite sequence of positive numbers such that, for n>2, a(n) has a common factor with a(n-1), no common factor with a(n-2), and the product a(n)*a(n-1) is distinct from all previous products, a(i)*a(i-1), i=2..n-1.
3

%I #11 Jun 21 2022 10:28:52

%S 1,2,6,15,35,14,6,33,55,10,6,21,35,10,12,21,77,22,6,39,65,10,14,21,15,

%T 10,22,33,15,20,14,63,15,40,14,77,33,12,14,91,39,12,20,35,63,6,26,65,

%U 15,12,22,55,15,18,28,35,45,12,26,91,21,30,22,143,39,15,50,22,99,15,70,22,187,51,6

%N Lexicographically earliest infinite sequence of positive numbers such that, for n>2, a(n) has a common factor with a(n-1), no common factor with a(n-2), and the product a(n)*a(n-1) is distinct from all previous products, a(i)*a(i-1), i=2..n-1.

%C Like the Enots Wolley sequence, A336957, no term a(n) can be a prime or a prime power as this would make it impossible to find a(n+1). As 6 is the smallest number to include two different primes, and hence the smallest number beyond the first two terms that can appear, it occurs frequently in the sequence, 1887 times in the first 250000 terms. See A355139 for the indices of these terms.

%C Unlike A336957 multiple odd successive terms occur, the longest such run in the first 250000 terms being fourteen starting at a(111799) = 20257.

%C See A355138 for the products of consecutive terms.

%H Scott R. Shannon, <a href="/A355061/a355061.png">Image of the first 250000 terms</a>. The green line is y = n.

%e a(5) = 35 as this is the smallest number to share a factor with a(4) = 15, not share a factor with a(3) = 6, and contains a prime factor not in a(4) = 15 and hence allows a(6) to exist.

%e a(7) = 6 as this is the smallest number to share a factor with a(6) = 14, not share a factor with a(5) = 35, and contains a prime factor not in a(6) = 14 and hence allows a(8) to exist. This is the first term to differ from A336957.

%o (Python)

%o from sympy import primefactors

%o from itertools import count, islice

%o def agen(): # generator of terms

%o an1, an, f1, f, pset = 2, 6, {2}, {2, 3}, {2, 12}

%o yield from [1, 2, 6]

%o for n in count(4):

%o an2, an1, an, f2, f1 = an1, an, 6, f1, f

%o f = set(primefactors(an))

%o while an*an1 in pset or f1&f == set() or f2&f != set() or f <= f1:

%o an += 1; f = set(primefactors(an))

%o pset.add(an*an1); yield an

%o print(list(islice(agen(), 75))) # _Michael S. Branicky_, Jun 20 2022

%Y Cf. A355138, A355139, A336957, A098550, A064413.

%K nonn

%O 1,2

%A _Scott R. Shannon_, Jun 16 2022