Floors are numbered by skipping fours, Find actual number of floors.












2












$begingroup$


How do you find the number of floors,in a tetraphobic numbering system like 1,2,3,5,6,7,..,12,13,15..,39,50.



I am trying to find the pattern and the mathematical algorithm to solve for floor numbered n.



for eg
n = 3 : ans = 3
n = 8 : ans = 7
n = 22 : ans = 20



Note: This is not a HW problem , I read about it and tried to solve it as fun, I am stuck so I am asking here










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Why do you have 12 in there?
    $endgroup$
    – Mohammad Zuhair Khan
    Jan 26 at 7:46










  • $begingroup$
    @MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
    $endgroup$
    – saulspatz
    Jan 26 at 9:24


















2












$begingroup$


How do you find the number of floors,in a tetraphobic numbering system like 1,2,3,5,6,7,..,12,13,15..,39,50.



I am trying to find the pattern and the mathematical algorithm to solve for floor numbered n.



for eg
n = 3 : ans = 3
n = 8 : ans = 7
n = 22 : ans = 20



Note: This is not a HW problem , I read about it and tried to solve it as fun, I am stuck so I am asking here










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Why do you have 12 in there?
    $endgroup$
    – Mohammad Zuhair Khan
    Jan 26 at 7:46










  • $begingroup$
    @MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
    $endgroup$
    – saulspatz
    Jan 26 at 9:24
















2












2








2





$begingroup$


How do you find the number of floors,in a tetraphobic numbering system like 1,2,3,5,6,7,..,12,13,15..,39,50.



I am trying to find the pattern and the mathematical algorithm to solve for floor numbered n.



for eg
n = 3 : ans = 3
n = 8 : ans = 7
n = 22 : ans = 20



Note: This is not a HW problem , I read about it and tried to solve it as fun, I am stuck so I am asking here










share|cite|improve this question









$endgroup$




How do you find the number of floors,in a tetraphobic numbering system like 1,2,3,5,6,7,..,12,13,15..,39,50.



I am trying to find the pattern and the mathematical algorithm to solve for floor numbered n.



for eg
n = 3 : ans = 3
n = 8 : ans = 7
n = 22 : ans = 20



Note: This is not a HW problem , I read about it and tried to solve it as fun, I am stuck so I am asking here







combinatorics elementary-number-theory






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 26 at 7:27









Ajinkya GawaliAjinkya Gawali

212




212








  • 1




    $begingroup$
    Why do you have 12 in there?
    $endgroup$
    – Mohammad Zuhair Khan
    Jan 26 at 7:46










  • $begingroup$
    @MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
    $endgroup$
    – saulspatz
    Jan 26 at 9:24
















  • 1




    $begingroup$
    Why do you have 12 in there?
    $endgroup$
    – Mohammad Zuhair Khan
    Jan 26 at 7:46










  • $begingroup$
    @MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
    $endgroup$
    – saulspatz
    Jan 26 at 9:24










1




1




$begingroup$
Why do you have 12 in there?
$endgroup$
– Mohammad Zuhair Khan
Jan 26 at 7:46




$begingroup$
Why do you have 12 in there?
$endgroup$
– Mohammad Zuhair Khan
Jan 26 at 7:46












$begingroup$
@MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
$endgroup$
– saulspatz
Jan 26 at 9:24






$begingroup$
@MohammadZuhairKhan I think the OP is leaving out all numbers in which the digit $4$ occurs. That's why he skips from $39$ to $50.$
$endgroup$
– saulspatz
Jan 26 at 9:24












2 Answers
2






active

oldest

votes


















1












$begingroup$

I'll do an example. You can elaborate it into an algorithm. Which floor has number $7619?$



The way to approach this is to count how many floors we skip. Call $10$ consecutive two-digit numbers where the first ends in $1$ and the last in $0$ a "decade." Similarly define a "century" and a "millennium." In a decade that starts with $4$ we skip $10$ numbers, and in a decade that doesn't start with $4$ we skip $1$ number, so in a century that doesn't start with $4$ we skip $19$ numbers and in a millennium that doesn't start with $4$ we skip $100+9cdot19=271$ numbers.



Now back to $7619.$ There are $7$ millennia up to $7000$. In one of them we skip $1000$ number and in $6$ of them we skip $271$ giving $2626.$ Now we have to figure out how many are skipped from $7001$ to $7619.$ This is clearly the same number that are skip from $1$ to $619$. There are $6$ centuries up to $600$ and in one of them we skip $100$ numbers, and in the other $5$ we skip $19$, making $195,$ and a total of $2821$ so far. Now we have to count how many number are skipped from $601$ to $619$ which is the same as the number skipped from $1$ to $19$. We can apply the same idea and get $2,$ so that $2823$ numbers are skipped in all.



The final answer is $7619-2823=4796$






share|cite|improve this answer









$endgroup$





















    1












    $begingroup$

    I found a better answer. The floor number are in basically in base-9 as it never uses one number (0-3 and 5-9) where as the number of floors is in base-10 (0-9) because it uses all decimal digits.



    We convert the floor number to proper base-9 number decrementing all digits that are greater than 4 by 1. Once you have a base-9 number , convert it to base-10.
    Eg. Floor-number : 56
    Base -9. : 45
    Base-10 (Ans): 41






    share|cite|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.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2fmath.stackexchange.com%2fquestions%2f3087992%2ffloors-are-numbered-by-skipping-fours-find-actual-number-of-floors%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









      1












      $begingroup$

      I'll do an example. You can elaborate it into an algorithm. Which floor has number $7619?$



      The way to approach this is to count how many floors we skip. Call $10$ consecutive two-digit numbers where the first ends in $1$ and the last in $0$ a "decade." Similarly define a "century" and a "millennium." In a decade that starts with $4$ we skip $10$ numbers, and in a decade that doesn't start with $4$ we skip $1$ number, so in a century that doesn't start with $4$ we skip $19$ numbers and in a millennium that doesn't start with $4$ we skip $100+9cdot19=271$ numbers.



      Now back to $7619.$ There are $7$ millennia up to $7000$. In one of them we skip $1000$ number and in $6$ of them we skip $271$ giving $2626.$ Now we have to figure out how many are skipped from $7001$ to $7619.$ This is clearly the same number that are skip from $1$ to $619$. There are $6$ centuries up to $600$ and in one of them we skip $100$ numbers, and in the other $5$ we skip $19$, making $195,$ and a total of $2821$ so far. Now we have to count how many number are skipped from $601$ to $619$ which is the same as the number skipped from $1$ to $19$. We can apply the same idea and get $2,$ so that $2823$ numbers are skipped in all.



      The final answer is $7619-2823=4796$






      share|cite|improve this answer









      $endgroup$


















        1












        $begingroup$

        I'll do an example. You can elaborate it into an algorithm. Which floor has number $7619?$



        The way to approach this is to count how many floors we skip. Call $10$ consecutive two-digit numbers where the first ends in $1$ and the last in $0$ a "decade." Similarly define a "century" and a "millennium." In a decade that starts with $4$ we skip $10$ numbers, and in a decade that doesn't start with $4$ we skip $1$ number, so in a century that doesn't start with $4$ we skip $19$ numbers and in a millennium that doesn't start with $4$ we skip $100+9cdot19=271$ numbers.



        Now back to $7619.$ There are $7$ millennia up to $7000$. In one of them we skip $1000$ number and in $6$ of them we skip $271$ giving $2626.$ Now we have to figure out how many are skipped from $7001$ to $7619.$ This is clearly the same number that are skip from $1$ to $619$. There are $6$ centuries up to $600$ and in one of them we skip $100$ numbers, and in the other $5$ we skip $19$, making $195,$ and a total of $2821$ so far. Now we have to count how many number are skipped from $601$ to $619$ which is the same as the number skipped from $1$ to $19$. We can apply the same idea and get $2,$ so that $2823$ numbers are skipped in all.



        The final answer is $7619-2823=4796$






        share|cite|improve this answer









        $endgroup$
















          1












          1








          1





          $begingroup$

          I'll do an example. You can elaborate it into an algorithm. Which floor has number $7619?$



          The way to approach this is to count how many floors we skip. Call $10$ consecutive two-digit numbers where the first ends in $1$ and the last in $0$ a "decade." Similarly define a "century" and a "millennium." In a decade that starts with $4$ we skip $10$ numbers, and in a decade that doesn't start with $4$ we skip $1$ number, so in a century that doesn't start with $4$ we skip $19$ numbers and in a millennium that doesn't start with $4$ we skip $100+9cdot19=271$ numbers.



          Now back to $7619.$ There are $7$ millennia up to $7000$. In one of them we skip $1000$ number and in $6$ of them we skip $271$ giving $2626.$ Now we have to figure out how many are skipped from $7001$ to $7619.$ This is clearly the same number that are skip from $1$ to $619$. There are $6$ centuries up to $600$ and in one of them we skip $100$ numbers, and in the other $5$ we skip $19$, making $195,$ and a total of $2821$ so far. Now we have to count how many number are skipped from $601$ to $619$ which is the same as the number skipped from $1$ to $19$. We can apply the same idea and get $2,$ so that $2823$ numbers are skipped in all.



          The final answer is $7619-2823=4796$






          share|cite|improve this answer









          $endgroup$



          I'll do an example. You can elaborate it into an algorithm. Which floor has number $7619?$



          The way to approach this is to count how many floors we skip. Call $10$ consecutive two-digit numbers where the first ends in $1$ and the last in $0$ a "decade." Similarly define a "century" and a "millennium." In a decade that starts with $4$ we skip $10$ numbers, and in a decade that doesn't start with $4$ we skip $1$ number, so in a century that doesn't start with $4$ we skip $19$ numbers and in a millennium that doesn't start with $4$ we skip $100+9cdot19=271$ numbers.



          Now back to $7619.$ There are $7$ millennia up to $7000$. In one of them we skip $1000$ number and in $6$ of them we skip $271$ giving $2626.$ Now we have to figure out how many are skipped from $7001$ to $7619.$ This is clearly the same number that are skip from $1$ to $619$. There are $6$ centuries up to $600$ and in one of them we skip $100$ numbers, and in the other $5$ we skip $19$, making $195,$ and a total of $2821$ so far. Now we have to count how many number are skipped from $601$ to $619$ which is the same as the number skipped from $1$ to $19$. We can apply the same idea and get $2,$ so that $2823$ numbers are skipped in all.



          The final answer is $7619-2823=4796$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 26 at 9:48









          saulspatzsaulspatz

          17k31435




          17k31435























              1












              $begingroup$

              I found a better answer. The floor number are in basically in base-9 as it never uses one number (0-3 and 5-9) where as the number of floors is in base-10 (0-9) because it uses all decimal digits.



              We convert the floor number to proper base-9 number decrementing all digits that are greater than 4 by 1. Once you have a base-9 number , convert it to base-10.
              Eg. Floor-number : 56
              Base -9. : 45
              Base-10 (Ans): 41






              share|cite|improve this answer









              $endgroup$


















                1












                $begingroup$

                I found a better answer. The floor number are in basically in base-9 as it never uses one number (0-3 and 5-9) where as the number of floors is in base-10 (0-9) because it uses all decimal digits.



                We convert the floor number to proper base-9 number decrementing all digits that are greater than 4 by 1. Once you have a base-9 number , convert it to base-10.
                Eg. Floor-number : 56
                Base -9. : 45
                Base-10 (Ans): 41






                share|cite|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  I found a better answer. The floor number are in basically in base-9 as it never uses one number (0-3 and 5-9) where as the number of floors is in base-10 (0-9) because it uses all decimal digits.



                  We convert the floor number to proper base-9 number decrementing all digits that are greater than 4 by 1. Once you have a base-9 number , convert it to base-10.
                  Eg. Floor-number : 56
                  Base -9. : 45
                  Base-10 (Ans): 41






                  share|cite|improve this answer









                  $endgroup$



                  I found a better answer. The floor number are in basically in base-9 as it never uses one number (0-3 and 5-9) where as the number of floors is in base-10 (0-9) because it uses all decimal digits.



                  We convert the floor number to proper base-9 number decrementing all digits that are greater than 4 by 1. Once you have a base-9 number , convert it to base-10.
                  Eg. Floor-number : 56
                  Base -9. : 45
                  Base-10 (Ans): 41







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jan 27 at 8:45









                  Ajinkya GawaliAjinkya Gawali

                  212




                  212






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087992%2ffloors-are-numbered-by-skipping-fours-find-actual-number-of-floors%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

                      Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                      Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                      A Topological Invariant for $pi_3(U(n))$