Sum of Beautiful Subsequences
For each element, track how many strictly increasing subsequences end there with each GCD; extending by a larger element updates those GCDs.
For each element, track how many strictly increasing subsequences end there with each GCD; extending by a larger element updates those GCDs.