Tessellate S.T.E.M.S. (2019) - Computer Science - School - Set 4 - Objective Problem 1

Computer Science Level pending

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 1 , 2 , . . . 100 1,2,...100 . Find the sum of all the elements of the lexicographically maximum result of its transformation.

For example, for the sequence 1 , 2 , 3 1,2,3 the lexicographically maximum result is 1 , 1 , 3 1,1,3 . This can be obtained as follows:

  • Append G C D ( 1 , 2 , 3 ) GCD(1,2,3) = 1 1 , remove 2 2 .
  • Append G C D ( 1 , 3 ) GCD(1,3) = 1 1 , remove 2 2 .
  • Append G C D ( 3 ) GCD(3) = 3 3 , remove 3 3 .

Hence the required answer for this case is 1 + 1 + 3 = 5 1+1+3=5


This problem is a part of Tessellate S.T.E.M.S (2019)

275 199 408 392

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.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...