Let's call the following process a transformation of a sequence of length n.
If the sequence is empty, the process ends. Otherwise, append the greatest common divisor (GCD) of all the elements of the sequence to the result and remove one arbitrary element from the sequence. Thus, when the process ends, we have a sequence of n integers: the greatest common divisors of all the elements in the sequence before each deletion. You are given the integer sequence . Find the sum of all the elements of the lexicographically maximum result of its transformation.
For example, for the sequence the lexicographically maximum result is . This can be obtained as follows:
Hence the required answer for this case is
This problem is a part of Tessellate S.T.E.M.S (2019)
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No explanations have been posted yet. Check back later!