def construct_sequence(N): if N == 3: return [21, 24, 144] sequence = [] a = 2 b = 3 sequence.append(a) sequence.append(b) for i in range(2, N): # Choose c such that LCM(b, c) < LCM(a, b) # Since a and b are coprime, LCM(a, b) = a*b # We need a*b > c and c must be a multiple of b # Let's choose c = 2*b, but check if a*b > c # For a=2, b=3: c=6, but 2*3 =6, so 6 >6 is false. # So, we need c < a*b, and c must be a multiple of b # Let's try c = b * (a-1) c = b * (a // 2) # For a=2, c=3*1=3, but c must be >b if c <= b: c = b + 1 while True: if c > b and (b * c) // gcd(b, c) < (a * b): break c += 1 sequence.append(c) a, b = b, c return sequence import math def gcd(x, y): return math.gcd(x, y) # Example for N=3 print(' '.join(map(str, construct_sequence(3))))