Removing 100 digits from the first 100 numbers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
12
down vote

favorite












Write the first 100 positive integers next to each other to form one big number: $$123456789101112131415161718192021dots90919293949596979899100.$$ If we remove 100 digits (not necessarily consecutive) from this big number, what is the largest possible number that could remain? And the smallest? (Leading zeroes are not permitted.)



Based on a problem from the Moscow Mathematical Olympiad. Seems hard, but the solution is quick and elegant once you spot it.










share|improve this question

























    up vote
    12
    down vote

    favorite












    Write the first 100 positive integers next to each other to form one big number: $$123456789101112131415161718192021dots90919293949596979899100.$$ If we remove 100 digits (not necessarily consecutive) from this big number, what is the largest possible number that could remain? And the smallest? (Leading zeroes are not permitted.)



    Based on a problem from the Moscow Mathematical Olympiad. Seems hard, but the solution is quick and elegant once you spot it.










    share|improve this question























      up vote
      12
      down vote

      favorite









      up vote
      12
      down vote

      favorite











      Write the first 100 positive integers next to each other to form one big number: $$123456789101112131415161718192021dots90919293949596979899100.$$ If we remove 100 digits (not necessarily consecutive) from this big number, what is the largest possible number that could remain? And the smallest? (Leading zeroes are not permitted.)



      Based on a problem from the Moscow Mathematical Olympiad. Seems hard, but the solution is quick and elegant once you spot it.










      share|improve this question













      Write the first 100 positive integers next to each other to form one big number: $$123456789101112131415161718192021dots90919293949596979899100.$$ If we remove 100 digits (not necessarily consecutive) from this big number, what is the largest possible number that could remain? And the smallest? (Leading zeroes are not permitted.)



      Based on a problem from the Moscow Mathematical Olympiad. Seems hard, but the solution is quick and elegant once you spot it.







      mathematics optimization






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 8 at 11:07









      Rand al'Thor

      67.7k13224454




      67.7k13224454




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          13
          down vote













          The biggest one is




          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          We can't influence the number's length (there's a fixed number of digits), so to maximize the value we take the maximal first digit, then second digit etc.


          Remove the 84 first non-nines (16 digits left to remove):

          999995051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The largest number within the next 17 digits is 7, so from here, the next digit in the answer can be at most 7 (we can't remove more than 16 digits). So remove 15 non-7's... (1 digit left to remove):
          999997585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          From here, the next digit can be at most 8 so remove one non-8 from the middle:
          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          The smallest one is




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          Remove 85 non-zeros (leave leading 1). 15 left...

          10000051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 16 digits is 1. Remove 1 non-1 (14 left to remove):

          1000001525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 15 digits is 2. Remove 1 non-2 (13 left to remove):

          100000125354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 14 digits is 3. Remove 1 non-3 (12 left to remove):

          10000012354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 13 digits is 4. Remove 1 non-4 (11 left to remove):

          1000001234555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 12 digits is 0. Remove 11 non-0's (0 left to remove):

          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100







          share|improve this answer






















          • Correct! But could you explain the "next digit can be at most ..." parts?
            – Rand al'Thor
            Aug 8 at 11:25










          • Added an explanation, plus the answer for the second part.
            – jafe
            Aug 8 at 11:30






          • 1




            You can do better for the second part ...
            – Rand al'Thor
            Aug 8 at 11:34










          • Argh, you're right.
            – jafe
            Aug 8 at 11:37






          • 1




            @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
            – El-Guest
            Aug 8 at 13:27

















          up vote
          6
          down vote













          First of all, we remove




          $100$ digits whatsoever and we cannot change any digit place, so in order to get the biggest or smallest number we need to play with the first digits as big/small as possible. Since 9 is the biggest digit, to make it biggest, we need to try to get as many 9-digit as possible, if somehow it is not possible to get 9 by removing the digits (it will happen examplified below), we need to consider the next biggest digit 8 and etc....




          So




          To get 9, we need to remove first 8 digits from 123456789101112...,




          Then




          Remove every 19 digits after 9 because the next 9 is after 19 digits, then look for another 9 and continue removing...




          and our number becomes something like below after removing 84 digits:




          99999950515253545556575859.......




          and we have




          16 digit left to remove but we cannot reach to 9 because the next 9 is 19 digits after like before... so we should consider getting 8 in 16 digit, can we reach to 8 with 16 digits? no, then 7? yes after 15 digits luckily..!




          so then




          remove 15 digits again




          then our number becomes:




          99999975859..... with 1 digit removing option!




          Lastly,




          remove $5$ which is between $7$ and $8$, since we dont have 9 after 1 digit, only 8 is biggest possible number!




          then the number becomes




          9999997859606162....





          For the smallest one, the same logic is applicable,




          Remove numbers until we encounter $0$.




          The frequency of




          $0$ in the sequence is 19 again




          so our number becomes




          10000051525354555657585960....




          Then we have 15 digits left to remove so with the same principle




          if we remove $15$ digits, we will not able to reach $0$, then we should look for $1$.




          First




          $1$ exists in the next digit, so remove 1 digit only, then look for another one for the 14 digits if we cant find $1$, look for $2$ etc... this is the general methodology to find the biggest or smallest number.




          So our number becomes (if I did not mess up)




          10000012340616263....







          share|improve this answer






















          • I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
            – Rand al'Thor
            Aug 8 at 11:24











          • @Randal'Thor did it fast, let me fix it :D
            – Oray
            Aug 8 at 11:26

















          up vote
          2
          down vote













          I get the smallest one to be:




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Method:




          By following jafe's first 85 deletions, followed by the "5"s in 51,52,53,54 (leaving 1234), then the next 11 digits up the the "0" of 60.







          share|improve this answer




















          • Which is the same as Oray's answer, which I'd not seen - oops!
            – Phil M Jones
            Aug 8 at 13:22










          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "559"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f69117%2fremoving-100-digits-from-the-first-100-numbers%23new-answer', 'question_page');

          );

          Post as a guest






























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          13
          down vote













          The biggest one is




          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          We can't influence the number's length (there's a fixed number of digits), so to maximize the value we take the maximal first digit, then second digit etc.


          Remove the 84 first non-nines (16 digits left to remove):

          999995051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The largest number within the next 17 digits is 7, so from here, the next digit in the answer can be at most 7 (we can't remove more than 16 digits). So remove 15 non-7's... (1 digit left to remove):
          999997585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          From here, the next digit can be at most 8 so remove one non-8 from the middle:
          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          The smallest one is




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          Remove 85 non-zeros (leave leading 1). 15 left...

          10000051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 16 digits is 1. Remove 1 non-1 (14 left to remove):

          1000001525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 15 digits is 2. Remove 1 non-2 (13 left to remove):

          100000125354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 14 digits is 3. Remove 1 non-3 (12 left to remove):

          10000012354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 13 digits is 4. Remove 1 non-4 (11 left to remove):

          1000001234555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 12 digits is 0. Remove 11 non-0's (0 left to remove):

          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100







          share|improve this answer






















          • Correct! But could you explain the "next digit can be at most ..." parts?
            – Rand al'Thor
            Aug 8 at 11:25










          • Added an explanation, plus the answer for the second part.
            – jafe
            Aug 8 at 11:30






          • 1




            You can do better for the second part ...
            – Rand al'Thor
            Aug 8 at 11:34










          • Argh, you're right.
            – jafe
            Aug 8 at 11:37






          • 1




            @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
            – El-Guest
            Aug 8 at 13:27














          up vote
          13
          down vote













          The biggest one is




          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          We can't influence the number's length (there's a fixed number of digits), so to maximize the value we take the maximal first digit, then second digit etc.


          Remove the 84 first non-nines (16 digits left to remove):

          999995051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The largest number within the next 17 digits is 7, so from here, the next digit in the answer can be at most 7 (we can't remove more than 16 digits). So remove 15 non-7's... (1 digit left to remove):
          999997585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          From here, the next digit can be at most 8 so remove one non-8 from the middle:
          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          The smallest one is




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          Remove 85 non-zeros (leave leading 1). 15 left...

          10000051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 16 digits is 1. Remove 1 non-1 (14 left to remove):

          1000001525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 15 digits is 2. Remove 1 non-2 (13 left to remove):

          100000125354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 14 digits is 3. Remove 1 non-3 (12 left to remove):

          10000012354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 13 digits is 4. Remove 1 non-4 (11 left to remove):

          1000001234555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 12 digits is 0. Remove 11 non-0's (0 left to remove):

          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100







          share|improve this answer






















          • Correct! But could you explain the "next digit can be at most ..." parts?
            – Rand al'Thor
            Aug 8 at 11:25










          • Added an explanation, plus the answer for the second part.
            – jafe
            Aug 8 at 11:30






          • 1




            You can do better for the second part ...
            – Rand al'Thor
            Aug 8 at 11:34










          • Argh, you're right.
            – jafe
            Aug 8 at 11:37






          • 1




            @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
            – El-Guest
            Aug 8 at 13:27












          up vote
          13
          down vote










          up vote
          13
          down vote









          The biggest one is




          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          We can't influence the number's length (there's a fixed number of digits), so to maximize the value we take the maximal first digit, then second digit etc.


          Remove the 84 first non-nines (16 digits left to remove):

          999995051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The largest number within the next 17 digits is 7, so from here, the next digit in the answer can be at most 7 (we can't remove more than 16 digits). So remove 15 non-7's... (1 digit left to remove):
          999997585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          From here, the next digit can be at most 8 so remove one non-8 from the middle:
          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          The smallest one is




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          Remove 85 non-zeros (leave leading 1). 15 left...

          10000051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 16 digits is 1. Remove 1 non-1 (14 left to remove):

          1000001525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 15 digits is 2. Remove 1 non-2 (13 left to remove):

          100000125354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 14 digits is 3. Remove 1 non-3 (12 left to remove):

          10000012354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 13 digits is 4. Remove 1 non-4 (11 left to remove):

          1000001234555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 12 digits is 0. Remove 11 non-0's (0 left to remove):

          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100







          share|improve this answer














          The biggest one is




          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          We can't influence the number's length (there's a fixed number of digits), so to maximize the value we take the maximal first digit, then second digit etc.


          Remove the 84 first non-nines (16 digits left to remove):

          999995051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The largest number within the next 17 digits is 7, so from here, the next digit in the answer can be at most 7 (we can't remove more than 16 digits). So remove 15 non-7's... (1 digit left to remove):
          999997585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          From here, the next digit can be at most 8 so remove one non-8 from the middle:
          99999785960616263646566676869707172737475767778798081828384858687888990919293949596979899100




          The smallest one is




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Because




          Remove 85 non-zeros (leave leading 1). 15 left...

          10000051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 16 digits is 1. Remove 1 non-1 (14 left to remove):

          1000001525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 15 digits is 2. Remove 1 non-2 (13 left to remove):

          100000125354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 14 digits is 3. Remove 1 non-3 (12 left to remove):

          10000012354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 13 digits is 4. Remove 1 non-4 (11 left to remove):

          1000001234555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100


          The smallest number in the next 12 digits is 0. Remove 11 non-0's (0 left to remove):

          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 8 at 13:26









          El-Guest

          12.9k2763




          12.9k2763










          answered Aug 8 at 11:21









          jafe

          6,3201577




          6,3201577











          • Correct! But could you explain the "next digit can be at most ..." parts?
            – Rand al'Thor
            Aug 8 at 11:25










          • Added an explanation, plus the answer for the second part.
            – jafe
            Aug 8 at 11:30






          • 1




            You can do better for the second part ...
            – Rand al'Thor
            Aug 8 at 11:34










          • Argh, you're right.
            – jafe
            Aug 8 at 11:37






          • 1




            @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
            – El-Guest
            Aug 8 at 13:27
















          • Correct! But could you explain the "next digit can be at most ..." parts?
            – Rand al'Thor
            Aug 8 at 11:25










          • Added an explanation, plus the answer for the second part.
            – jafe
            Aug 8 at 11:30






          • 1




            You can do better for the second part ...
            – Rand al'Thor
            Aug 8 at 11:34










          • Argh, you're right.
            – jafe
            Aug 8 at 11:37






          • 1




            @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
            – El-Guest
            Aug 8 at 13:27















          Correct! But could you explain the "next digit can be at most ..." parts?
          – Rand al'Thor
          Aug 8 at 11:25




          Correct! But could you explain the "next digit can be at most ..." parts?
          – Rand al'Thor
          Aug 8 at 11:25












          Added an explanation, plus the answer for the second part.
          – jafe
          Aug 8 at 11:30




          Added an explanation, plus the answer for the second part.
          – jafe
          Aug 8 at 11:30




          1




          1




          You can do better for the second part ...
          – Rand al'Thor
          Aug 8 at 11:34




          You can do better for the second part ...
          – Rand al'Thor
          Aug 8 at 11:34












          Argh, you're right.
          – jafe
          Aug 8 at 11:37




          Argh, you're right.
          – jafe
          Aug 8 at 11:37




          1




          1




          @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
          – El-Guest
          Aug 8 at 13:27




          @jafe I updated your "smallest" answer to reflect your final step; I believe this is right now (and matches the smallest answers of the other answers). Feel free to roll back if this is not what you were intending.
          – El-Guest
          Aug 8 at 13:27










          up vote
          6
          down vote













          First of all, we remove




          $100$ digits whatsoever and we cannot change any digit place, so in order to get the biggest or smallest number we need to play with the first digits as big/small as possible. Since 9 is the biggest digit, to make it biggest, we need to try to get as many 9-digit as possible, if somehow it is not possible to get 9 by removing the digits (it will happen examplified below), we need to consider the next biggest digit 8 and etc....




          So




          To get 9, we need to remove first 8 digits from 123456789101112...,




          Then




          Remove every 19 digits after 9 because the next 9 is after 19 digits, then look for another 9 and continue removing...




          and our number becomes something like below after removing 84 digits:




          99999950515253545556575859.......




          and we have




          16 digit left to remove but we cannot reach to 9 because the next 9 is 19 digits after like before... so we should consider getting 8 in 16 digit, can we reach to 8 with 16 digits? no, then 7? yes after 15 digits luckily..!




          so then




          remove 15 digits again




          then our number becomes:




          99999975859..... with 1 digit removing option!




          Lastly,




          remove $5$ which is between $7$ and $8$, since we dont have 9 after 1 digit, only 8 is biggest possible number!




          then the number becomes




          9999997859606162....





          For the smallest one, the same logic is applicable,




          Remove numbers until we encounter $0$.




          The frequency of




          $0$ in the sequence is 19 again




          so our number becomes




          10000051525354555657585960....




          Then we have 15 digits left to remove so with the same principle




          if we remove $15$ digits, we will not able to reach $0$, then we should look for $1$.




          First




          $1$ exists in the next digit, so remove 1 digit only, then look for another one for the 14 digits if we cant find $1$, look for $2$ etc... this is the general methodology to find the biggest or smallest number.




          So our number becomes (if I did not mess up)




          10000012340616263....







          share|improve this answer






















          • I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
            – Rand al'Thor
            Aug 8 at 11:24











          • @Randal'Thor did it fast, let me fix it :D
            – Oray
            Aug 8 at 11:26














          up vote
          6
          down vote













          First of all, we remove




          $100$ digits whatsoever and we cannot change any digit place, so in order to get the biggest or smallest number we need to play with the first digits as big/small as possible. Since 9 is the biggest digit, to make it biggest, we need to try to get as many 9-digit as possible, if somehow it is not possible to get 9 by removing the digits (it will happen examplified below), we need to consider the next biggest digit 8 and etc....




          So




          To get 9, we need to remove first 8 digits from 123456789101112...,




          Then




          Remove every 19 digits after 9 because the next 9 is after 19 digits, then look for another 9 and continue removing...




          and our number becomes something like below after removing 84 digits:




          99999950515253545556575859.......




          and we have




          16 digit left to remove but we cannot reach to 9 because the next 9 is 19 digits after like before... so we should consider getting 8 in 16 digit, can we reach to 8 with 16 digits? no, then 7? yes after 15 digits luckily..!




          so then




          remove 15 digits again




          then our number becomes:




          99999975859..... with 1 digit removing option!




          Lastly,




          remove $5$ which is between $7$ and $8$, since we dont have 9 after 1 digit, only 8 is biggest possible number!




          then the number becomes




          9999997859606162....





          For the smallest one, the same logic is applicable,




          Remove numbers until we encounter $0$.




          The frequency of




          $0$ in the sequence is 19 again




          so our number becomes




          10000051525354555657585960....




          Then we have 15 digits left to remove so with the same principle




          if we remove $15$ digits, we will not able to reach $0$, then we should look for $1$.




          First




          $1$ exists in the next digit, so remove 1 digit only, then look for another one for the 14 digits if we cant find $1$, look for $2$ etc... this is the general methodology to find the biggest or smallest number.




          So our number becomes (if I did not mess up)




          10000012340616263....







          share|improve this answer






















          • I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
            – Rand al'Thor
            Aug 8 at 11:24











          • @Randal'Thor did it fast, let me fix it :D
            – Oray
            Aug 8 at 11:26












          up vote
          6
          down vote










          up vote
          6
          down vote









          First of all, we remove




          $100$ digits whatsoever and we cannot change any digit place, so in order to get the biggest or smallest number we need to play with the first digits as big/small as possible. Since 9 is the biggest digit, to make it biggest, we need to try to get as many 9-digit as possible, if somehow it is not possible to get 9 by removing the digits (it will happen examplified below), we need to consider the next biggest digit 8 and etc....




          So




          To get 9, we need to remove first 8 digits from 123456789101112...,




          Then




          Remove every 19 digits after 9 because the next 9 is after 19 digits, then look for another 9 and continue removing...




          and our number becomes something like below after removing 84 digits:




          99999950515253545556575859.......




          and we have




          16 digit left to remove but we cannot reach to 9 because the next 9 is 19 digits after like before... so we should consider getting 8 in 16 digit, can we reach to 8 with 16 digits? no, then 7? yes after 15 digits luckily..!




          so then




          remove 15 digits again




          then our number becomes:




          99999975859..... with 1 digit removing option!




          Lastly,




          remove $5$ which is between $7$ and $8$, since we dont have 9 after 1 digit, only 8 is biggest possible number!




          then the number becomes




          9999997859606162....





          For the smallest one, the same logic is applicable,




          Remove numbers until we encounter $0$.




          The frequency of




          $0$ in the sequence is 19 again




          so our number becomes




          10000051525354555657585960....




          Then we have 15 digits left to remove so with the same principle




          if we remove $15$ digits, we will not able to reach $0$, then we should look for $1$.




          First




          $1$ exists in the next digit, so remove 1 digit only, then look for another one for the 14 digits if we cant find $1$, look for $2$ etc... this is the general methodology to find the biggest or smallest number.




          So our number becomes (if I did not mess up)




          10000012340616263....







          share|improve this answer














          First of all, we remove




          $100$ digits whatsoever and we cannot change any digit place, so in order to get the biggest or smallest number we need to play with the first digits as big/small as possible. Since 9 is the biggest digit, to make it biggest, we need to try to get as many 9-digit as possible, if somehow it is not possible to get 9 by removing the digits (it will happen examplified below), we need to consider the next biggest digit 8 and etc....




          So




          To get 9, we need to remove first 8 digits from 123456789101112...,




          Then




          Remove every 19 digits after 9 because the next 9 is after 19 digits, then look for another 9 and continue removing...




          and our number becomes something like below after removing 84 digits:




          99999950515253545556575859.......




          and we have




          16 digit left to remove but we cannot reach to 9 because the next 9 is 19 digits after like before... so we should consider getting 8 in 16 digit, can we reach to 8 with 16 digits? no, then 7? yes after 15 digits luckily..!




          so then




          remove 15 digits again




          then our number becomes:




          99999975859..... with 1 digit removing option!




          Lastly,




          remove $5$ which is between $7$ and $8$, since we dont have 9 after 1 digit, only 8 is biggest possible number!




          then the number becomes




          9999997859606162....





          For the smallest one, the same logic is applicable,




          Remove numbers until we encounter $0$.




          The frequency of




          $0$ in the sequence is 19 again




          so our number becomes




          10000051525354555657585960....




          Then we have 15 digits left to remove so with the same principle




          if we remove $15$ digits, we will not able to reach $0$, then we should look for $1$.




          First




          $1$ exists in the next digit, so remove 1 digit only, then look for another one for the 14 digits if we cant find $1$, look for $2$ etc... this is the general methodology to find the biggest or smallest number.




          So our number becomes (if I did not mess up)




          10000012340616263....








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 8 at 13:54

























          answered Aug 8 at 11:18









          Oray

          14.7k435143




          14.7k435143











          • I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
            – Rand al'Thor
            Aug 8 at 11:24











          • @Randal'Thor did it fast, let me fix it :D
            – Oray
            Aug 8 at 11:26
















          • I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
            – Rand al'Thor
            Aug 8 at 11:24











          • @Randal'Thor did it fast, let me fix it :D
            – Oray
            Aug 8 at 11:26















          I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
          – Rand al'Thor
          Aug 8 at 11:24





          I think you've miscounted somewhere and removed fewer than 100 digits. The methodology is good though!
          – Rand al'Thor
          Aug 8 at 11:24













          @Randal'Thor did it fast, let me fix it :D
          – Oray
          Aug 8 at 11:26




          @Randal'Thor did it fast, let me fix it :D
          – Oray
          Aug 8 at 11:26










          up vote
          2
          down vote













          I get the smallest one to be:




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Method:




          By following jafe's first 85 deletions, followed by the "5"s in 51,52,53,54 (leaving 1234), then the next 11 digits up the the "0" of 60.







          share|improve this answer




















          • Which is the same as Oray's answer, which I'd not seen - oops!
            – Phil M Jones
            Aug 8 at 13:22














          up vote
          2
          down vote













          I get the smallest one to be:




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Method:




          By following jafe's first 85 deletions, followed by the "5"s in 51,52,53,54 (leaving 1234), then the next 11 digits up the the "0" of 60.







          share|improve this answer




















          • Which is the same as Oray's answer, which I'd not seen - oops!
            – Phil M Jones
            Aug 8 at 13:22












          up vote
          2
          down vote










          up vote
          2
          down vote









          I get the smallest one to be:




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Method:




          By following jafe's first 85 deletions, followed by the "5"s in 51,52,53,54 (leaving 1234), then the next 11 digits up the the "0" of 60.







          share|improve this answer












          I get the smallest one to be:




          10000012340616263646566676869707172737475767778798081828384858687888990919293949596979899100




          Method:




          By following jafe's first 85 deletions, followed by the "5"s in 51,52,53,54 (leaving 1234), then the next 11 digits up the the "0" of 60.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 8 at 13:21









          Phil M Jones

          387110




          387110











          • Which is the same as Oray's answer, which I'd not seen - oops!
            – Phil M Jones
            Aug 8 at 13:22
















          • Which is the same as Oray's answer, which I'd not seen - oops!
            – Phil M Jones
            Aug 8 at 13:22















          Which is the same as Oray's answer, which I'd not seen - oops!
          – Phil M Jones
          Aug 8 at 13:22




          Which is the same as Oray's answer, which I'd not seen - oops!
          – Phil M Jones
          Aug 8 at 13:22

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f69117%2fremoving-100-digits-from-the-first-100-numbers%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491