login
a(n) is the smallest integer greater than a(n-1) such that all consecutive products in a(1)..a(n) are distinct, with a(1) = 2.
3

%I #59 Feb 03 2026 14:41:10

%S 2,3,4,5,7,8,9,10,11,13,14,15,17,18,19,21,22,23,25,26,27,28,29,30,31,

%T 32,33,34,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,

%U 57,58,59,61,62,63,64,65,66,67,68,69,70,71,73,74,75,76,77,78

%N a(n) is the smallest integer greater than a(n-1) such that all consecutive products in a(1)..a(n) are distinct, with a(1) = 2.

%C Greedy sequence corresponding to the 421st Erdős Problem.

%H Touch Sungkawichai, <a href="/A389544/b389544.txt">Table of n, a(n) for n = 1..20000</a>

%H Thomas F. Bloom, <a href="https://www.erdosproblems.com/forum/thread/421">Erdős Problem #421</a>

%o (Python)

%o from itertools import count, islice

%o def A389544_gen(): # generator of terms

%o an, conP, endP = 2, {1, 2}, {1, 2} # an; set of all consecutive/ending products resp.

%o while True:

%o yield an

%o an = next(k for k in count(an+1) if k not in conP and all(k*p not in conP for p in endP))

%o endP = {an} | {an*p for p in endP}

%o conP |= endP

%o print(list(islice(A389544_gen(), 68))) # _Michael S. Branicky_, Jan 04 2026

%Y Cf. A001055, A333559, A390848 (complement), A392241.

%K nonn,nice

%O 1,1

%A _Touch Sungkawichai_, Jan 02 2026