100 Fruits for 100 Dollars a more challenging version











up vote
6
down vote

favorite












This is a more challenging version of the reported puzzle " How will you get 100 fruits in Rs. 100? "




Bob buys 4 different fruits for exactly 100 dollars



Jackfruits cost 15 dollars each



Papayas cost 1 dollar each



Bananas cost 0.29 dollars each



Strawberries cost 0.13 dollars each



There are 100 fruits in total



The number of each fruit he buys is a Prime Number. So he buys at least
2 of each fruit. All the numbers are different




So how many Jackfruits, papayas, bananas and strawberries did he buy?



Please explain the logic.



No Programming please










share|improve this question




























    up vote
    6
    down vote

    favorite












    This is a more challenging version of the reported puzzle " How will you get 100 fruits in Rs. 100? "




    Bob buys 4 different fruits for exactly 100 dollars



    Jackfruits cost 15 dollars each



    Papayas cost 1 dollar each



    Bananas cost 0.29 dollars each



    Strawberries cost 0.13 dollars each



    There are 100 fruits in total



    The number of each fruit he buys is a Prime Number. So he buys at least
    2 of each fruit. All the numbers are different




    So how many Jackfruits, papayas, bananas and strawberries did he buy?



    Please explain the logic.



    No Programming please










    share|improve this question


























      up vote
      6
      down vote

      favorite









      up vote
      6
      down vote

      favorite











      This is a more challenging version of the reported puzzle " How will you get 100 fruits in Rs. 100? "




      Bob buys 4 different fruits for exactly 100 dollars



      Jackfruits cost 15 dollars each



      Papayas cost 1 dollar each



      Bananas cost 0.29 dollars each



      Strawberries cost 0.13 dollars each



      There are 100 fruits in total



      The number of each fruit he buys is a Prime Number. So he buys at least
      2 of each fruit. All the numbers are different




      So how many Jackfruits, papayas, bananas and strawberries did he buy?



      Please explain the logic.



      No Programming please










      share|improve this question















      This is a more challenging version of the reported puzzle " How will you get 100 fruits in Rs. 100? "




      Bob buys 4 different fruits for exactly 100 dollars



      Jackfruits cost 15 dollars each



      Papayas cost 1 dollar each



      Bananas cost 0.29 dollars each



      Strawberries cost 0.13 dollars each



      There are 100 fruits in total



      The number of each fruit he buys is a Prime Number. So he buys at least
      2 of each fruit. All the numbers are different




      So how many Jackfruits, papayas, bananas and strawberries did he buy?



      Please explain the logic.



      No Programming please







      mathematics logical-deduction no-computers






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 6 at 23:25









      thumbtackthief

      26317




      26317










      asked Nov 6 at 12:17









      DEEM

      4,8081289




      4,8081289






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          18
          down vote



          accepted










          As instructed by Great Teacher Gareth, let's put the fruit on sale, and lower each price by a dollar:





          • Jackfruits, now only 14 dollars each!

          • Papayas FOR FREE!

          • Get 71 cents with every free Banana!

          • Take our Strawberries, and we'll give you 87 cents!




          and then we'll try to




          spend exactly zero dollars. We instantly notice how this makes the number of papayas irrelevant, so we'll just have to figure out the rest, and then "fill up to 100" with papayas.




          We'll want to figure out a




          prime numbered combination of strawberries and bananas that ends up at either -28, -42, or -70 dollars, because those are the possible costs of jackfruit that we need to offset.




          Let's use trial and error, which is now easy, since we have a definite target:




          Start with the largest prime number of bananas that fits inside the target price, and 2 strawberries. If the sum is too high, lower the number of bananas, and if it's too low, add strawberries, always skipping any non-prime values. This process makes quick work of the checking process, while making sure you won't miss any solutions. (I used a calculator for this, which may be against the spirit of the no-computers tag, though.)




          By doing so, we get that




          * We cannot get to -28 at all

          * We cannot get to -42 at all

          * The only way to get to -70 is to get 41 bananas and 47 strawberries




          That seems nice, and the numbers are smaller than a 100, so all that remains to be done is to check the number of papayas for primality.




          Adding up the other numbers, we know that there must be 7 papayas.




          Yay, it IS prime, and it's different from the other numbers, so we have a solution!




          * 5 Jackfruits

          * 7 Papayas

          * 41 Bananas

          * 47 Strawberries







          share|improve this answer























          • Adds to 102 @ Bass Typo perhaps?
            – DEEM
            Nov 6 at 13:35










          • Thanks, @DEEM, definitely.
            – Bass
            Nov 6 at 13:36


















          up vote
          5
          down vote













          Solution:




          47 strawberries

          41 bananas

          7 papayas

          5 jackfruits




          How to solve it:




          First, convert everything to cents, so we can work with integers.
          So a strawberry cost 13 cents, a banana 29, a papaya 100 and a jackfruit 1500. We would like to buy 100 fruits in total, which cost 10000 cents altogether.
          The number of strawberries bought determines the number of bananas to be bought, as their total cost has to be divisible by 100, as the other kind of fruits each have a cost divisible by hundred, and so does our total budget.
          To determine this connection between the number of strawberries and bananas, we have to find the multiplicative inverse of 29 (price of bananas) modulo 100. This happens to be 69, as 29*69=2001.
          Given this, if the number of strawberries is x, the number of bananas has to be (x*13*(100-69) mod 100), that is (3*x mod 100). Indeed it is easy to check that 1*13+3*29=100, and you can find this without looking for modular multiplicative inverses.

          There have to be more than 33 strawberries (for the multiplication by three to force a carry in the hundreds), otherwise the number of bananas cannot be prime.
          If we also consider the criteria about the total number of fruits being 100, that gives new boundaries for the number of strawberries: it either has to be between 34 and 50 (the carry is 1 in these cases) or between 67 and 75 (the carry is 2).




          As it happens,




          none of the primes in interval [67,75] work, as for 67, we get 1 banana (not prime), and for 71 and 73 the budget left for papayas and jackfruits is 8700 and 8500, which makes the number of papayas to be a compound number divisible by 3 or 5 respectively.

          The primes in the interval [34,50] all give primes for the needed number of bananas as well. Trying to use the least amount of papayas to have a budget which is divisible by 1500 (price of jackfruit) leaves us with 47 as the only solution, as for all the other cases the difference of 100 (target number of fruits) and the actual number of bought fruits is not divisible by 14, which is a necessary condition to be fulfilled - as 1 jackfruit could be replaced by 15 papayas for the same price, increasing the total number of fruits by 14.







          share|improve this answer























          • Was it still trial and error or some logic?
            – DEEM
            Nov 6 at 12:54










          • @DEEM Is there an existing logical solution?
            – rhsquared
            Nov 6 at 13:19






          • 1




            Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
            – DEEM
            Nov 6 at 13:34










          • @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
            – elias
            Nov 7 at 9:29











          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: 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
          },
          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%2f74744%2f100-fruits-for-100-dollars-a-more-challenging-version%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          18
          down vote



          accepted










          As instructed by Great Teacher Gareth, let's put the fruit on sale, and lower each price by a dollar:





          • Jackfruits, now only 14 dollars each!

          • Papayas FOR FREE!

          • Get 71 cents with every free Banana!

          • Take our Strawberries, and we'll give you 87 cents!




          and then we'll try to




          spend exactly zero dollars. We instantly notice how this makes the number of papayas irrelevant, so we'll just have to figure out the rest, and then "fill up to 100" with papayas.




          We'll want to figure out a




          prime numbered combination of strawberries and bananas that ends up at either -28, -42, or -70 dollars, because those are the possible costs of jackfruit that we need to offset.




          Let's use trial and error, which is now easy, since we have a definite target:




          Start with the largest prime number of bananas that fits inside the target price, and 2 strawberries. If the sum is too high, lower the number of bananas, and if it's too low, add strawberries, always skipping any non-prime values. This process makes quick work of the checking process, while making sure you won't miss any solutions. (I used a calculator for this, which may be against the spirit of the no-computers tag, though.)




          By doing so, we get that




          * We cannot get to -28 at all

          * We cannot get to -42 at all

          * The only way to get to -70 is to get 41 bananas and 47 strawberries




          That seems nice, and the numbers are smaller than a 100, so all that remains to be done is to check the number of papayas for primality.




          Adding up the other numbers, we know that there must be 7 papayas.




          Yay, it IS prime, and it's different from the other numbers, so we have a solution!




          * 5 Jackfruits

          * 7 Papayas

          * 41 Bananas

          * 47 Strawberries







          share|improve this answer























          • Adds to 102 @ Bass Typo perhaps?
            – DEEM
            Nov 6 at 13:35










          • Thanks, @DEEM, definitely.
            – Bass
            Nov 6 at 13:36















          up vote
          18
          down vote



          accepted










          As instructed by Great Teacher Gareth, let's put the fruit on sale, and lower each price by a dollar:





          • Jackfruits, now only 14 dollars each!

          • Papayas FOR FREE!

          • Get 71 cents with every free Banana!

          • Take our Strawberries, and we'll give you 87 cents!




          and then we'll try to




          spend exactly zero dollars. We instantly notice how this makes the number of papayas irrelevant, so we'll just have to figure out the rest, and then "fill up to 100" with papayas.




          We'll want to figure out a




          prime numbered combination of strawberries and bananas that ends up at either -28, -42, or -70 dollars, because those are the possible costs of jackfruit that we need to offset.




          Let's use trial and error, which is now easy, since we have a definite target:




          Start with the largest prime number of bananas that fits inside the target price, and 2 strawberries. If the sum is too high, lower the number of bananas, and if it's too low, add strawberries, always skipping any non-prime values. This process makes quick work of the checking process, while making sure you won't miss any solutions. (I used a calculator for this, which may be against the spirit of the no-computers tag, though.)




          By doing so, we get that




          * We cannot get to -28 at all

          * We cannot get to -42 at all

          * The only way to get to -70 is to get 41 bananas and 47 strawberries




          That seems nice, and the numbers are smaller than a 100, so all that remains to be done is to check the number of papayas for primality.




          Adding up the other numbers, we know that there must be 7 papayas.




          Yay, it IS prime, and it's different from the other numbers, so we have a solution!




          * 5 Jackfruits

          * 7 Papayas

          * 41 Bananas

          * 47 Strawberries







          share|improve this answer























          • Adds to 102 @ Bass Typo perhaps?
            – DEEM
            Nov 6 at 13:35










          • Thanks, @DEEM, definitely.
            – Bass
            Nov 6 at 13:36













          up vote
          18
          down vote



          accepted







          up vote
          18
          down vote



          accepted






          As instructed by Great Teacher Gareth, let's put the fruit on sale, and lower each price by a dollar:





          • Jackfruits, now only 14 dollars each!

          • Papayas FOR FREE!

          • Get 71 cents with every free Banana!

          • Take our Strawberries, and we'll give you 87 cents!




          and then we'll try to




          spend exactly zero dollars. We instantly notice how this makes the number of papayas irrelevant, so we'll just have to figure out the rest, and then "fill up to 100" with papayas.




          We'll want to figure out a




          prime numbered combination of strawberries and bananas that ends up at either -28, -42, or -70 dollars, because those are the possible costs of jackfruit that we need to offset.




          Let's use trial and error, which is now easy, since we have a definite target:




          Start with the largest prime number of bananas that fits inside the target price, and 2 strawberries. If the sum is too high, lower the number of bananas, and if it's too low, add strawberries, always skipping any non-prime values. This process makes quick work of the checking process, while making sure you won't miss any solutions. (I used a calculator for this, which may be against the spirit of the no-computers tag, though.)




          By doing so, we get that




          * We cannot get to -28 at all

          * We cannot get to -42 at all

          * The only way to get to -70 is to get 41 bananas and 47 strawberries




          That seems nice, and the numbers are smaller than a 100, so all that remains to be done is to check the number of papayas for primality.




          Adding up the other numbers, we know that there must be 7 papayas.




          Yay, it IS prime, and it's different from the other numbers, so we have a solution!




          * 5 Jackfruits

          * 7 Papayas

          * 41 Bananas

          * 47 Strawberries







          share|improve this answer














          As instructed by Great Teacher Gareth, let's put the fruit on sale, and lower each price by a dollar:





          • Jackfruits, now only 14 dollars each!

          • Papayas FOR FREE!

          • Get 71 cents with every free Banana!

          • Take our Strawberries, and we'll give you 87 cents!




          and then we'll try to




          spend exactly zero dollars. We instantly notice how this makes the number of papayas irrelevant, so we'll just have to figure out the rest, and then "fill up to 100" with papayas.




          We'll want to figure out a




          prime numbered combination of strawberries and bananas that ends up at either -28, -42, or -70 dollars, because those are the possible costs of jackfruit that we need to offset.




          Let's use trial and error, which is now easy, since we have a definite target:




          Start with the largest prime number of bananas that fits inside the target price, and 2 strawberries. If the sum is too high, lower the number of bananas, and if it's too low, add strawberries, always skipping any non-prime values. This process makes quick work of the checking process, while making sure you won't miss any solutions. (I used a calculator for this, which may be against the spirit of the no-computers tag, though.)




          By doing so, we get that




          * We cannot get to -28 at all

          * We cannot get to -42 at all

          * The only way to get to -70 is to get 41 bananas and 47 strawberries




          That seems nice, and the numbers are smaller than a 100, so all that remains to be done is to check the number of papayas for primality.




          Adding up the other numbers, we know that there must be 7 papayas.




          Yay, it IS prime, and it's different from the other numbers, so we have a solution!




          * 5 Jackfruits

          * 7 Papayas

          * 41 Bananas

          * 47 Strawberries








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 6 at 16:50

























          answered Nov 6 at 13:33









          Bass

          26k462164




          26k462164












          • Adds to 102 @ Bass Typo perhaps?
            – DEEM
            Nov 6 at 13:35










          • Thanks, @DEEM, definitely.
            – Bass
            Nov 6 at 13:36


















          • Adds to 102 @ Bass Typo perhaps?
            – DEEM
            Nov 6 at 13:35










          • Thanks, @DEEM, definitely.
            – Bass
            Nov 6 at 13:36
















          Adds to 102 @ Bass Typo perhaps?
          – DEEM
          Nov 6 at 13:35




          Adds to 102 @ Bass Typo perhaps?
          – DEEM
          Nov 6 at 13:35












          Thanks, @DEEM, definitely.
          – Bass
          Nov 6 at 13:36




          Thanks, @DEEM, definitely.
          – Bass
          Nov 6 at 13:36










          up vote
          5
          down vote













          Solution:




          47 strawberries

          41 bananas

          7 papayas

          5 jackfruits




          How to solve it:




          First, convert everything to cents, so we can work with integers.
          So a strawberry cost 13 cents, a banana 29, a papaya 100 and a jackfruit 1500. We would like to buy 100 fruits in total, which cost 10000 cents altogether.
          The number of strawberries bought determines the number of bananas to be bought, as their total cost has to be divisible by 100, as the other kind of fruits each have a cost divisible by hundred, and so does our total budget.
          To determine this connection between the number of strawberries and bananas, we have to find the multiplicative inverse of 29 (price of bananas) modulo 100. This happens to be 69, as 29*69=2001.
          Given this, if the number of strawberries is x, the number of bananas has to be (x*13*(100-69) mod 100), that is (3*x mod 100). Indeed it is easy to check that 1*13+3*29=100, and you can find this without looking for modular multiplicative inverses.

          There have to be more than 33 strawberries (for the multiplication by three to force a carry in the hundreds), otherwise the number of bananas cannot be prime.
          If we also consider the criteria about the total number of fruits being 100, that gives new boundaries for the number of strawberries: it either has to be between 34 and 50 (the carry is 1 in these cases) or between 67 and 75 (the carry is 2).




          As it happens,




          none of the primes in interval [67,75] work, as for 67, we get 1 banana (not prime), and for 71 and 73 the budget left for papayas and jackfruits is 8700 and 8500, which makes the number of papayas to be a compound number divisible by 3 or 5 respectively.

          The primes in the interval [34,50] all give primes for the needed number of bananas as well. Trying to use the least amount of papayas to have a budget which is divisible by 1500 (price of jackfruit) leaves us with 47 as the only solution, as for all the other cases the difference of 100 (target number of fruits) and the actual number of bought fruits is not divisible by 14, which is a necessary condition to be fulfilled - as 1 jackfruit could be replaced by 15 papayas for the same price, increasing the total number of fruits by 14.







          share|improve this answer























          • Was it still trial and error or some logic?
            – DEEM
            Nov 6 at 12:54










          • @DEEM Is there an existing logical solution?
            – rhsquared
            Nov 6 at 13:19






          • 1




            Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
            – DEEM
            Nov 6 at 13:34










          • @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
            – elias
            Nov 7 at 9:29















          up vote
          5
          down vote













          Solution:




          47 strawberries

          41 bananas

          7 papayas

          5 jackfruits




          How to solve it:




          First, convert everything to cents, so we can work with integers.
          So a strawberry cost 13 cents, a banana 29, a papaya 100 and a jackfruit 1500. We would like to buy 100 fruits in total, which cost 10000 cents altogether.
          The number of strawberries bought determines the number of bananas to be bought, as their total cost has to be divisible by 100, as the other kind of fruits each have a cost divisible by hundred, and so does our total budget.
          To determine this connection between the number of strawberries and bananas, we have to find the multiplicative inverse of 29 (price of bananas) modulo 100. This happens to be 69, as 29*69=2001.
          Given this, if the number of strawberries is x, the number of bananas has to be (x*13*(100-69) mod 100), that is (3*x mod 100). Indeed it is easy to check that 1*13+3*29=100, and you can find this without looking for modular multiplicative inverses.

          There have to be more than 33 strawberries (for the multiplication by three to force a carry in the hundreds), otherwise the number of bananas cannot be prime.
          If we also consider the criteria about the total number of fruits being 100, that gives new boundaries for the number of strawberries: it either has to be between 34 and 50 (the carry is 1 in these cases) or between 67 and 75 (the carry is 2).




          As it happens,




          none of the primes in interval [67,75] work, as for 67, we get 1 banana (not prime), and for 71 and 73 the budget left for papayas and jackfruits is 8700 and 8500, which makes the number of papayas to be a compound number divisible by 3 or 5 respectively.

          The primes in the interval [34,50] all give primes for the needed number of bananas as well. Trying to use the least amount of papayas to have a budget which is divisible by 1500 (price of jackfruit) leaves us with 47 as the only solution, as for all the other cases the difference of 100 (target number of fruits) and the actual number of bought fruits is not divisible by 14, which is a necessary condition to be fulfilled - as 1 jackfruit could be replaced by 15 papayas for the same price, increasing the total number of fruits by 14.







          share|improve this answer























          • Was it still trial and error or some logic?
            – DEEM
            Nov 6 at 12:54










          • @DEEM Is there an existing logical solution?
            – rhsquared
            Nov 6 at 13:19






          • 1




            Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
            – DEEM
            Nov 6 at 13:34










          • @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
            – elias
            Nov 7 at 9:29













          up vote
          5
          down vote










          up vote
          5
          down vote









          Solution:




          47 strawberries

          41 bananas

          7 papayas

          5 jackfruits




          How to solve it:




          First, convert everything to cents, so we can work with integers.
          So a strawberry cost 13 cents, a banana 29, a papaya 100 and a jackfruit 1500. We would like to buy 100 fruits in total, which cost 10000 cents altogether.
          The number of strawberries bought determines the number of bananas to be bought, as their total cost has to be divisible by 100, as the other kind of fruits each have a cost divisible by hundred, and so does our total budget.
          To determine this connection between the number of strawberries and bananas, we have to find the multiplicative inverse of 29 (price of bananas) modulo 100. This happens to be 69, as 29*69=2001.
          Given this, if the number of strawberries is x, the number of bananas has to be (x*13*(100-69) mod 100), that is (3*x mod 100). Indeed it is easy to check that 1*13+3*29=100, and you can find this without looking for modular multiplicative inverses.

          There have to be more than 33 strawberries (for the multiplication by three to force a carry in the hundreds), otherwise the number of bananas cannot be prime.
          If we also consider the criteria about the total number of fruits being 100, that gives new boundaries for the number of strawberries: it either has to be between 34 and 50 (the carry is 1 in these cases) or between 67 and 75 (the carry is 2).




          As it happens,




          none of the primes in interval [67,75] work, as for 67, we get 1 banana (not prime), and for 71 and 73 the budget left for papayas and jackfruits is 8700 and 8500, which makes the number of papayas to be a compound number divisible by 3 or 5 respectively.

          The primes in the interval [34,50] all give primes for the needed number of bananas as well. Trying to use the least amount of papayas to have a budget which is divisible by 1500 (price of jackfruit) leaves us with 47 as the only solution, as for all the other cases the difference of 100 (target number of fruits) and the actual number of bought fruits is not divisible by 14, which is a necessary condition to be fulfilled - as 1 jackfruit could be replaced by 15 papayas for the same price, increasing the total number of fruits by 14.







          share|improve this answer














          Solution:




          47 strawberries

          41 bananas

          7 papayas

          5 jackfruits




          How to solve it:




          First, convert everything to cents, so we can work with integers.
          So a strawberry cost 13 cents, a banana 29, a papaya 100 and a jackfruit 1500. We would like to buy 100 fruits in total, which cost 10000 cents altogether.
          The number of strawberries bought determines the number of bananas to be bought, as their total cost has to be divisible by 100, as the other kind of fruits each have a cost divisible by hundred, and so does our total budget.
          To determine this connection between the number of strawberries and bananas, we have to find the multiplicative inverse of 29 (price of bananas) modulo 100. This happens to be 69, as 29*69=2001.
          Given this, if the number of strawberries is x, the number of bananas has to be (x*13*(100-69) mod 100), that is (3*x mod 100). Indeed it is easy to check that 1*13+3*29=100, and you can find this without looking for modular multiplicative inverses.

          There have to be more than 33 strawberries (for the multiplication by three to force a carry in the hundreds), otherwise the number of bananas cannot be prime.
          If we also consider the criteria about the total number of fruits being 100, that gives new boundaries for the number of strawberries: it either has to be between 34 and 50 (the carry is 1 in these cases) or between 67 and 75 (the carry is 2).




          As it happens,




          none of the primes in interval [67,75] work, as for 67, we get 1 banana (not prime), and for 71 and 73 the budget left for papayas and jackfruits is 8700 and 8500, which makes the number of papayas to be a compound number divisible by 3 or 5 respectively.

          The primes in the interval [34,50] all give primes for the needed number of bananas as well. Trying to use the least amount of papayas to have a budget which is divisible by 1500 (price of jackfruit) leaves us with 47 as the only solution, as for all the other cases the difference of 100 (target number of fruits) and the actual number of bought fruits is not divisible by 14, which is a necessary condition to be fulfilled - as 1 jackfruit could be replaced by 15 papayas for the same price, increasing the total number of fruits by 14.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 6 at 13:28

























          answered Nov 6 at 12:51









          elias

          8,49332152




          8,49332152












          • Was it still trial and error or some logic?
            – DEEM
            Nov 6 at 12:54










          • @DEEM Is there an existing logical solution?
            – rhsquared
            Nov 6 at 13:19






          • 1




            Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
            – DEEM
            Nov 6 at 13:34










          • @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
            – elias
            Nov 7 at 9:29


















          • Was it still trial and error or some logic?
            – DEEM
            Nov 6 at 12:54










          • @DEEM Is there an existing logical solution?
            – rhsquared
            Nov 6 at 13:19






          • 1




            Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
            – DEEM
            Nov 6 at 13:34










          • @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
            – elias
            Nov 7 at 9:29
















          Was it still trial and error or some logic?
          – DEEM
          Nov 6 at 12:54




          Was it still trial and error or some logic?
          – DEEM
          Nov 6 at 12:54












          @DEEM Is there an existing logical solution?
          – rhsquared
          Nov 6 at 13:19




          @DEEM Is there an existing logical solution?
          – rhsquared
          Nov 6 at 13:19




          1




          1




          Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
          – DEEM
          Nov 6 at 13:34




          Of course this answer is right. But when I came up with the puzzle, I started with "elimination" logic. For example Jackfruits cannot be >5 so only 2,3 and 5. Cannot be 2 because 3 prime numbers will not add to 98.
          – DEEM
          Nov 6 at 13:34












          @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
          – elias
          Nov 7 at 9:29




          @DEEM, it would be interesting to see your approach being applied to solve the problem. I'd personally like to see a solution not using any kind of trial an error. Could you maybe share your method as an answer?
          – elias
          Nov 7 at 9:29


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f74744%2f100-fruits-for-100-dollars-a-more-challenging-version%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







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings