Gold nugget storage










6












$begingroup$


Given a positive integer, write it as the sum of numbers, where each of them is in $kt$. How many numbers at least are used? Shortest code win.



Samples:



Input Output Method
1 1 1
2 1 2
64 1 64
65 2 64+1
72 1 72
343 2 342+1
576 1 576
577 2 576+1
5184 1 5184
46656 9 5184+5184+5184+5184+5184+5184+5184+5184+5184
5274 2 5184+90


enter image description here










share|improve this question











$endgroup$







  • 4




    $begingroup$
    Could you give slightly more detail/put into words how the input results in the output?
    $endgroup$
    – Quintec
    Nov 11 '18 at 16:45






  • 2




    $begingroup$
    If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
    $endgroup$
    – trichoplax
    Nov 11 '18 at 16:52






  • 4




    $begingroup$
    Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
    $endgroup$
    – digEmAll
    Nov 11 '18 at 17:01







  • 2




    $begingroup$
    Are you trying to minimize the number of items or number of stacks?
    $endgroup$
    – fəˈnɛtɪk
    Nov 11 '18 at 17:02






  • 3




    $begingroup$
    I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
    $endgroup$
    – Black Owl Kai
    Nov 11 '18 at 21:03
















6












$begingroup$


Given a positive integer, write it as the sum of numbers, where each of them is in $kt$. How many numbers at least are used? Shortest code win.



Samples:



Input Output Method
1 1 1
2 1 2
64 1 64
65 2 64+1
72 1 72
343 2 342+1
576 1 576
577 2 576+1
5184 1 5184
46656 9 5184+5184+5184+5184+5184+5184+5184+5184+5184
5274 2 5184+90


enter image description here










share|improve this question











$endgroup$







  • 4




    $begingroup$
    Could you give slightly more detail/put into words how the input results in the output?
    $endgroup$
    – Quintec
    Nov 11 '18 at 16:45






  • 2




    $begingroup$
    If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
    $endgroup$
    – trichoplax
    Nov 11 '18 at 16:52






  • 4




    $begingroup$
    Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
    $endgroup$
    – digEmAll
    Nov 11 '18 at 17:01







  • 2




    $begingroup$
    Are you trying to minimize the number of items or number of stacks?
    $endgroup$
    – fəˈnɛtɪk
    Nov 11 '18 at 17:02






  • 3




    $begingroup$
    I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
    $endgroup$
    – Black Owl Kai
    Nov 11 '18 at 21:03














6












6








6


1



$begingroup$


Given a positive integer, write it as the sum of numbers, where each of them is in $kt$. How many numbers at least are used? Shortest code win.



Samples:



Input Output Method
1 1 1
2 1 2
64 1 64
65 2 64+1
72 1 72
343 2 342+1
576 1 576
577 2 576+1
5184 1 5184
46656 9 5184+5184+5184+5184+5184+5184+5184+5184+5184
5274 2 5184+90


enter image description here










share|improve this question











$endgroup$




Given a positive integer, write it as the sum of numbers, where each of them is in $kt$. How many numbers at least are used? Shortest code win.



Samples:



Input Output Method
1 1 1
2 1 2
64 1 64
65 2 64+1
72 1 72
343 2 342+1
576 1 576
577 2 576+1
5184 1 5184
46656 9 5184+5184+5184+5184+5184+5184+5184+5184+5184
5274 2 5184+90


enter image description here







code-golf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 '18 at 23:40







l4m2

















asked Nov 11 '18 at 16:34









l4m2l4m2

4,7361735




4,7361735







  • 4




    $begingroup$
    Could you give slightly more detail/put into words how the input results in the output?
    $endgroup$
    – Quintec
    Nov 11 '18 at 16:45






  • 2




    $begingroup$
    If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
    $endgroup$
    – trichoplax
    Nov 11 '18 at 16:52






  • 4




    $begingroup$
    Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
    $endgroup$
    – digEmAll
    Nov 11 '18 at 17:01







  • 2




    $begingroup$
    Are you trying to minimize the number of items or number of stacks?
    $endgroup$
    – fəˈnɛtɪk
    Nov 11 '18 at 17:02






  • 3




    $begingroup$
    I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
    $endgroup$
    – Black Owl Kai
    Nov 11 '18 at 21:03













  • 4




    $begingroup$
    Could you give slightly more detail/put into words how the input results in the output?
    $endgroup$
    – Quintec
    Nov 11 '18 at 16:45






  • 2




    $begingroup$
    If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
    $endgroup$
    – trichoplax
    Nov 11 '18 at 16:52






  • 4




    $begingroup$
    Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
    $endgroup$
    – digEmAll
    Nov 11 '18 at 17:01







  • 2




    $begingroup$
    Are you trying to minimize the number of items or number of stacks?
    $endgroup$
    – fəˈnɛtɪk
    Nov 11 '18 at 17:02






  • 3




    $begingroup$
    I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
    $endgroup$
    – Black Owl Kai
    Nov 11 '18 at 21:03








4




4




$begingroup$
Could you give slightly more detail/put into words how the input results in the output?
$endgroup$
– Quintec
Nov 11 '18 at 16:45




$begingroup$
Could you give slightly more detail/put into words how the input results in the output?
$endgroup$
– Quintec
Nov 11 '18 at 16:45




2




2




$begingroup$
If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
$endgroup$
– trichoplax
Nov 11 '18 at 16:52




$begingroup$
If something requires clarification in the comments, it would be useful to edit the challenge to include that clarification
$endgroup$
– trichoplax
Nov 11 '18 at 16:52




4




4




$begingroup$
Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
$endgroup$
– digEmAll
Nov 11 '18 at 17:01





$begingroup$
Is it basically a sort of change-making problem ? With the coins denominations being in the set 1,9,81 × 1...64 ?
$endgroup$
– digEmAll
Nov 11 '18 at 17:01





2




2




$begingroup$
Are you trying to minimize the number of items or number of stacks?
$endgroup$
– fəˈnɛtɪk
Nov 11 '18 at 17:02




$begingroup$
Are you trying to minimize the number of items or number of stacks?
$endgroup$
– fəˈnɛtɪk
Nov 11 '18 at 17:02




3




3




$begingroup$
I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
$endgroup$
– Black Owl Kai
Nov 11 '18 at 21:03





$begingroup$
I suggest adding 5274 = 64*81 + 10*9 as a test case, this checks if answers take as many blocks as possible if there are more than 576 nuggets and get 64*81 + 1*81 + 9*1 (as mine did)
$endgroup$
– Black Owl Kai
Nov 11 '18 at 21:03











5 Answers
5






active

oldest

votes


















3












$begingroup$


Jelly, 17 bytes



64R×9;Ɗ⁺ff€¥@ŒṗẈṂ


Try it online!



-1 thanks to Jonathan Allan.



Explanation (you can't test for inputs larger than 58 over TIO):



64R×9;Ɗ⁺ff€¥@ŒṗẈṂ Arguments: x
64R [1..64]
×9;Ɗ Multiply by 9, prepend to original list
⁺ Do the above once more
Œṗ Positive integer partitions of x
¥@ Call with reversed arguments (x = partitions, y = flattened outer product)
f€ For each partition in x, keep the elements that are in y
f Keep the elements of x that have remained intact after the above
Ẉ Lengths of the remaining partitions
Ṃ Minimum





share|improve this answer











$endgroup$












  • $begingroup$
    Since the output in testable area is trivial, can't quite check?
    $endgroup$
    – l4m2
    Nov 11 '18 at 23:35










  • $begingroup$
    @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
    $endgroup$
    – Erik the Outgolfer
    Nov 12 '18 at 8:37


















2












$begingroup$


Perl 6, 47 bytes





+($_,(*X-(1,9,81 X*^65)).grep(*>=0).min...^0)


Try it online!



A greedy algorithm seems to work.






share|improve this answer









$endgroup$




















    2












    $begingroup$

    JavaScript (ES6), 72 66 57 56 bytes



    Saved 1 byte thanks to @nwellnhof





    f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n>719?81:72):n-5184)


    Try it online!






    share|improve this answer











    $endgroup$












    • $begingroup$
      @nwellnhof This would fail for several values (576, 632, 633, ...)
      $endgroup$
      – Arnauld
      Nov 11 '18 at 21:57










    • $begingroup$
      I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
      $endgroup$
      – nwellnhof
      Nov 11 '18 at 22:59










    • $begingroup$
      @nwellnhof Yes, it does. :)
      $endgroup$
      – Arnauld
      Nov 11 '18 at 23:37


















    2












    $begingroup$


    05AB1E, 30 27 bytes



    ŽK≠‰`91vDy64*›i1sy9*%]64/îO


    Try it online! or verify all test cases



    -3 bytes thanks to Kevin Cruijssen



    This is my first 05AB1E submission, so I am sure that this can be optimized.






    share|improve this answer











    $endgroup$








    • 1




      $begingroup$
      Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
      $endgroup$
      – Kevin Cruijssen
      Nov 12 '18 at 7:31











    • $begingroup$
      @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
      $endgroup$
      – Black Owl Kai
      Nov 12 '18 at 7:56










    • $begingroup$
      Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
      $endgroup$
      – Kevin Cruijssen
      Nov 12 '18 at 8:00


















    0












    $begingroup$


    Wolfram Language (Mathematica), 66 bytes



    Min[Length/@IntegerPartitions[#,All,Union[#,9#,81#]&@Range@64,#]]&


    Try it online!






    share|improve this answer









    $endgroup$












      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.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "200"
      ;
      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175710%2fgold-nugget-storage%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3












      $begingroup$


      Jelly, 17 bytes



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ


      Try it online!



      -1 thanks to Jonathan Allan.



      Explanation (you can't test for inputs larger than 58 over TIO):



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ Arguments: x
      64R [1..64]
      ×9;Ɗ Multiply by 9, prepend to original list
      ⁺ Do the above once more
      Œṗ Positive integer partitions of x
      ¥@ Call with reversed arguments (x = partitions, y = flattened outer product)
      f€ For each partition in x, keep the elements that are in y
      f Keep the elements of x that have remained intact after the above
      Ẉ Lengths of the remaining partitions
      Ṃ Minimum





      share|improve this answer











      $endgroup$












      • $begingroup$
        Since the output in testable area is trivial, can't quite check?
        $endgroup$
        – l4m2
        Nov 11 '18 at 23:35










      • $begingroup$
        @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
        $endgroup$
        – Erik the Outgolfer
        Nov 12 '18 at 8:37















      3












      $begingroup$


      Jelly, 17 bytes



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ


      Try it online!



      -1 thanks to Jonathan Allan.



      Explanation (you can't test for inputs larger than 58 over TIO):



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ Arguments: x
      64R [1..64]
      ×9;Ɗ Multiply by 9, prepend to original list
      ⁺ Do the above once more
      Œṗ Positive integer partitions of x
      ¥@ Call with reversed arguments (x = partitions, y = flattened outer product)
      f€ For each partition in x, keep the elements that are in y
      f Keep the elements of x that have remained intact after the above
      Ẉ Lengths of the remaining partitions
      Ṃ Minimum





      share|improve this answer











      $endgroup$












      • $begingroup$
        Since the output in testable area is trivial, can't quite check?
        $endgroup$
        – l4m2
        Nov 11 '18 at 23:35










      • $begingroup$
        @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
        $endgroup$
        – Erik the Outgolfer
        Nov 12 '18 at 8:37













      3












      3








      3





      $begingroup$


      Jelly, 17 bytes



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ


      Try it online!



      -1 thanks to Jonathan Allan.



      Explanation (you can't test for inputs larger than 58 over TIO):



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ Arguments: x
      64R [1..64]
      ×9;Ɗ Multiply by 9, prepend to original list
      ⁺ Do the above once more
      Œṗ Positive integer partitions of x
      ¥@ Call with reversed arguments (x = partitions, y = flattened outer product)
      f€ For each partition in x, keep the elements that are in y
      f Keep the elements of x that have remained intact after the above
      Ẉ Lengths of the remaining partitions
      Ṃ Minimum





      share|improve this answer











      $endgroup$




      Jelly, 17 bytes



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ


      Try it online!



      -1 thanks to Jonathan Allan.



      Explanation (you can't test for inputs larger than 58 over TIO):



      64R×9;Ɗ⁺ff€¥@ŒṗẈṂ Arguments: x
      64R [1..64]
      ×9;Ɗ Multiply by 9, prepend to original list
      ⁺ Do the above once more
      Œṗ Positive integer partitions of x
      ¥@ Call with reversed arguments (x = partitions, y = flattened outer product)
      f€ For each partition in x, keep the elements that are in y
      f Keep the elements of x that have remained intact after the above
      Ẉ Lengths of the remaining partitions
      Ṃ Minimum






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 11 '18 at 20:15

























      answered Nov 11 '18 at 18:34









      Erik the OutgolferErik the Outgolfer

      31.8k429103




      31.8k429103











      • $begingroup$
        Since the output in testable area is trivial, can't quite check?
        $endgroup$
        – l4m2
        Nov 11 '18 at 23:35










      • $begingroup$
        @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
        $endgroup$
        – Erik the Outgolfer
        Nov 12 '18 at 8:37
















      • $begingroup$
        Since the output in testable area is trivial, can't quite check?
        $endgroup$
        – l4m2
        Nov 11 '18 at 23:35










      • $begingroup$
        @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
        $endgroup$
        – Erik the Outgolfer
        Nov 12 '18 at 8:37















      $begingroup$
      Since the output in testable area is trivial, can't quite check?
      $endgroup$
      – l4m2
      Nov 11 '18 at 23:35




      $begingroup$
      Since the output in testable area is trivial, can't quite check?
      $endgroup$
      – l4m2
      Nov 11 '18 at 23:35












      $begingroup$
      @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
      $endgroup$
      – Erik the Outgolfer
      Nov 12 '18 at 8:37




      $begingroup$
      @l4m2 You can't do so over TIO, but you might be able to do so if you install Jelly locally. That's why I've added the explanation.
      $endgroup$
      – Erik the Outgolfer
      Nov 12 '18 at 8:37











      2












      $begingroup$


      Perl 6, 47 bytes





      +($_,(*X-(1,9,81 X*^65)).grep(*>=0).min...^0)


      Try it online!



      A greedy algorithm seems to work.






      share|improve this answer









      $endgroup$

















        2












        $begingroup$


        Perl 6, 47 bytes





        +($_,(*X-(1,9,81 X*^65)).grep(*>=0).min...^0)


        Try it online!



        A greedy algorithm seems to work.






        share|improve this answer









        $endgroup$















          2












          2








          2





          $begingroup$


          Perl 6, 47 bytes





          +($_,(*X-(1,9,81 X*^65)).grep(*>=0).min...^0)


          Try it online!



          A greedy algorithm seems to work.






          share|improve this answer









          $endgroup$




          Perl 6, 47 bytes





          +($_,(*X-(1,9,81 X*^65)).grep(*>=0).min...^0)


          Try it online!



          A greedy algorithm seems to work.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 '18 at 23:36









          nwellnhofnwellnhof

          6,73511126




          6,73511126





















              2












              $begingroup$

              JavaScript (ES6), 72 66 57 56 bytes



              Saved 1 byte thanks to @nwellnhof





              f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n>719?81:72):n-5184)


              Try it online!






              share|improve this answer











              $endgroup$












              • $begingroup$
                @nwellnhof This would fail for several values (576, 632, 633, ...)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 21:57










              • $begingroup$
                I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
                $endgroup$
                – nwellnhof
                Nov 11 '18 at 22:59










              • $begingroup$
                @nwellnhof Yes, it does. :)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 23:37















              2












              $begingroup$

              JavaScript (ES6), 72 66 57 56 bytes



              Saved 1 byte thanks to @nwellnhof





              f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n>719?81:72):n-5184)


              Try it online!






              share|improve this answer











              $endgroup$












              • $begingroup$
                @nwellnhof This would fail for several values (576, 632, 633, ...)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 21:57










              • $begingroup$
                I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
                $endgroup$
                – nwellnhof
                Nov 11 '18 at 22:59










              • $begingroup$
                @nwellnhof Yes, it does. :)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 23:37













              2












              2








              2





              $begingroup$

              JavaScript (ES6), 72 66 57 56 bytes



              Saved 1 byte thanks to @nwellnhof





              f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n>719?81:72):n-5184)


              Try it online!






              share|improve this answer











              $endgroup$



              JavaScript (ES6), 72 66 57 56 bytes



              Saved 1 byte thanks to @nwellnhof





              f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n>719?81:72):n-5184)


              Try it online!







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 11 '18 at 23:37

























              answered Nov 11 '18 at 18:04









              ArnauldArnauld

              75.9k693320




              75.9k693320











              • $begingroup$
                @nwellnhof This would fail for several values (576, 632, 633, ...)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 21:57










              • $begingroup$
                I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
                $endgroup$
                – nwellnhof
                Nov 11 '18 at 22:59










              • $begingroup$
                @nwellnhof Yes, it does. :)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 23:37
















              • $begingroup$
                @nwellnhof This would fail for several values (576, 632, 633, ...)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 21:57










              • $begingroup$
                I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
                $endgroup$
                – nwellnhof
                Nov 11 '18 at 22:59










              • $begingroup$
                @nwellnhof Yes, it does. :)
                $endgroup$
                – Arnauld
                Nov 11 '18 at 23:37















              $begingroup$
              @nwellnhof This would fail for several values (576, 632, 633, ...)
              $endgroup$
              – Arnauld
              Nov 11 '18 at 21:57




              $begingroup$
              @nwellnhof This would fail for several values (576, 632, 633, ...)
              $endgroup$
              – Arnauld
              Nov 11 '18 at 21:57












              $begingroup$
              I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
              $endgroup$
              – nwellnhof
              Nov 11 '18 at 22:59




              $begingroup$
              I see. But f=n=>n&&1+f(n<5184?n>64&&n%(n<576?9:n<648?72:81):n-5184) (56 bytes) should work, right?
              $endgroup$
              – nwellnhof
              Nov 11 '18 at 22:59












              $begingroup$
              @nwellnhof Yes, it does. :)
              $endgroup$
              – Arnauld
              Nov 11 '18 at 23:37




              $begingroup$
              @nwellnhof Yes, it does. :)
              $endgroup$
              – Arnauld
              Nov 11 '18 at 23:37











              2












              $begingroup$


              05AB1E, 30 27 bytes



              ŽK≠‰`91vDy64*›i1sy9*%]64/îO


              Try it online! or verify all test cases



              -3 bytes thanks to Kevin Cruijssen



              This is my first 05AB1E submission, so I am sure that this can be optimized.






              share|improve this answer











              $endgroup$








              • 1




                $begingroup$
                Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 7:31











              • $begingroup$
                @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
                $endgroup$
                – Black Owl Kai
                Nov 12 '18 at 7:56










              • $begingroup$
                Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 8:00















              2












              $begingroup$


              05AB1E, 30 27 bytes



              ŽK≠‰`91vDy64*›i1sy9*%]64/îO


              Try it online! or verify all test cases



              -3 bytes thanks to Kevin Cruijssen



              This is my first 05AB1E submission, so I am sure that this can be optimized.






              share|improve this answer











              $endgroup$








              • 1




                $begingroup$
                Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 7:31











              • $begingroup$
                @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
                $endgroup$
                – Black Owl Kai
                Nov 12 '18 at 7:56










              • $begingroup$
                Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 8:00













              2












              2








              2





              $begingroup$


              05AB1E, 30 27 bytes



              ŽK≠‰`91vDy64*›i1sy9*%]64/îO


              Try it online! or verify all test cases



              -3 bytes thanks to Kevin Cruijssen



              This is my first 05AB1E submission, so I am sure that this can be optimized.






              share|improve this answer











              $endgroup$




              05AB1E, 30 27 bytes



              ŽK≠‰`91vDy64*›i1sy9*%]64/îO


              Try it online! or verify all test cases



              -3 bytes thanks to Kevin Cruijssen



              This is my first 05AB1E submission, so I am sure that this can be optimized.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 12 '18 at 7:56

























              answered Nov 11 '18 at 20:34









              Black Owl KaiBlack Owl Kai

              68011




              68011







              • 1




                $begingroup$
                Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 7:31











              • $begingroup$
                @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
                $endgroup$
                – Black Owl Kai
                Nov 12 '18 at 7:56










              • $begingroup$
                Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 8:00












              • 1




                $begingroup$
                Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 7:31











              • $begingroup$
                @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
                $endgroup$
                – Black Owl Kai
                Nov 12 '18 at 7:56










              • $begingroup$
                Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
                $endgroup$
                – Kevin Cruijssen
                Nov 12 '18 at 8:00







              1




              1




              $begingroup$
              Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
              $endgroup$
              – Kevin Cruijssen
              Nov 12 '18 at 7:31





              $begingroup$
              Not sure why you opted to choose the legacy version, since your answer also works in the new Elixir rewrite, but in the new version 5184 can be ŽK≠. In addition, the S after 91 can be removed since it's done implicitly; and }} can be ] (although you'd still need }} in your test suite on TIO). Try it online or verify all test cases.
              $endgroup$
              – Kevin Cruijssen
              Nov 12 '18 at 7:31













              $begingroup$
              @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
              $endgroup$
              – Black Owl Kai
              Nov 12 '18 at 7:56




              $begingroup$
              @KevinCruijssen I used the legacy version because tio.run/#05ab1e redirects there and because I didn't know about multiple versions.Thanks for the tips!
              $endgroup$
              – Black Owl Kai
              Nov 12 '18 at 7:56












              $begingroup$
              Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
              $endgroup$
              – Kevin Cruijssen
              Nov 12 '18 at 8:00




              $begingroup$
              Ah, I see. The legacy version is written in Python, and was used for the past few years. A few months back the Elixir rewrite was released as new version, with loads of new features. Some builtins have changed slightly, so I do still use the legacy version sometimes, but I mostly use the new version now. :) PS: If you haven't seen it yet: Tips for golfing in 05AB1E might be interesting to read through. And feel free to ask anything in the 05AB1E chat if you need help.
              $endgroup$
              – Kevin Cruijssen
              Nov 12 '18 at 8:00











              0












              $begingroup$


              Wolfram Language (Mathematica), 66 bytes



              Min[Length/@IntegerPartitions[#,All,Union[#,9#,81#]&@Range@64,#]]&


              Try it online!






              share|improve this answer









              $endgroup$

















                0












                $begingroup$


                Wolfram Language (Mathematica), 66 bytes



                Min[Length/@IntegerPartitions[#,All,Union[#,9#,81#]&@Range@64,#]]&


                Try it online!






                share|improve this answer









                $endgroup$















                  0












                  0








                  0





                  $begingroup$


                  Wolfram Language (Mathematica), 66 bytes



                  Min[Length/@IntegerPartitions[#,All,Union[#,9#,81#]&@Range@64,#]]&


                  Try it online!






                  share|improve this answer









                  $endgroup$




                  Wolfram Language (Mathematica), 66 bytes



                  Min[Length/@IntegerPartitions[#,All,Union[#,9#,81#]&@Range@64,#]]&


                  Try it online!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 '18 at 11:01









                  alephalphaalephalpha

                  21.3k32991




                  21.3k32991



























                      draft saved

                      draft discarded
















































                      If this is an answer to a challenge…



                      • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                      • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                        Explanations of your answer make it more interesting to read and are very much encouraged.


                      • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                      More generally…



                      • …Please make sure to answer the question and provide sufficient detail.


                      • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175710%2fgold-nugget-storage%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

                      How do I collapse sections of code in Visual Studio Code for Windows?

                      ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ