Find the Number of Subsequences With Equal GCD
Track the gcd of two disjoint growing subsequences at once, so each number either joins one side, joins the other, or is skipped.
Track the gcd of two disjoint growing subsequences at once, so each number either joins one side, joins the other, or is skipped.