Am I a Rude Number?Print the fingering for the note on a saxophoneProgram touch-tone instructions for my...

Cat is tipping over bed-side lamps during the night

Potential client has a problematic employee I can't work with

Why does magnet wire need to be insulated?

What makes papers publishable in top-tier journals?

Citing paywalled articles accessed via illegal web sharing

What is the difference between "...", '...', $'...', and $"..." quotes?

Why does photorec keep finding files after I have filled the disk free space as root?

False written accusations not made public - is there law to cover this?

Current across a wire with zero potential difference

Does diversity provide anything that meritocracy does not?

Can you tell from a blurry photo if focus was too close or too far?

How to visualize the Riemann-Roch theorem from complex analysis or geometric topology considerations?

Separate environment for personal and development use under macOS

How to make ice magic work from a scientific point of view?

What is the wife of a henpecked husband called?

Existence of Riemann surface, holomorphic maps

A Missing Symbol for This Logo

How can the probability of a fumble decrease linearly with more dice?

Changing the laptop's CPU. Should I reinstall Linux?

In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?

Is there any risk in sharing info about technologies and products we use with a supplier?

Airplane generations - how does it work?

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

How do you catch Smeargle in Pokemon Go?



Am I a Rude Number?


Print the fingering for the note on a saxophoneProgram touch-tone instructions for my fingersIs this even or odd?Is this number a factorial?Is this number triangular?Am I a Cullen Number?Am I an Automorphic Number?Is this any number?Octal Calculator with Primality checkIs it a Sphenic Number?













3












$begingroup$


For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of a problem when we get to the number four. Specifically, it requires us to put up our middle finger, which results in a rather unfortunate gesture, which is not typically accepted in society. This type of number is a rude number. We come to the next rude number at 36, when we raise the thumb on our second hand and the middle finger of our first hand. The definition of a rude number is any number that, under this system of counting, results in us putting up only the middle finger of any hand. Once we pass 1023 (the maximum number reachable on one hand), assume we continue with a third hand, with additional hands added as required.



Your Task:



Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a rude number.



Input:



An integer between 0 and 10^9 (inclusive).



Output:



A truthy/falsy value that indicates whether the input is a rude number.



Test Cases:



Input:    Output:
0 ---> falsy
3 ---> falsy
4 ---> truthy
25 ---> falsy
36 ---> truthy
127 ---> falsy
131 ---> truthy


Scoring:



This is code-golf, so the lowest score in bytes wins.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
    $endgroup$
    – Veskah
    1 hour ago






  • 1




    $begingroup$
    @Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    You can reach 1023 on one hand? O_o
    $endgroup$
    – ASCII-only
    17 mins ago










  • $begingroup$
    BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
    $endgroup$
    – ASCII-only
    5 mins ago
















3












$begingroup$


For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of a problem when we get to the number four. Specifically, it requires us to put up our middle finger, which results in a rather unfortunate gesture, which is not typically accepted in society. This type of number is a rude number. We come to the next rude number at 36, when we raise the thumb on our second hand and the middle finger of our first hand. The definition of a rude number is any number that, under this system of counting, results in us putting up only the middle finger of any hand. Once we pass 1023 (the maximum number reachable on one hand), assume we continue with a third hand, with additional hands added as required.



Your Task:



Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a rude number.



Input:



An integer between 0 and 10^9 (inclusive).



Output:



A truthy/falsy value that indicates whether the input is a rude number.



Test Cases:



Input:    Output:
0 ---> falsy
3 ---> falsy
4 ---> truthy
25 ---> falsy
36 ---> truthy
127 ---> falsy
131 ---> truthy


Scoring:



This is code-golf, so the lowest score in bytes wins.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
    $endgroup$
    – Veskah
    1 hour ago






  • 1




    $begingroup$
    @Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    You can reach 1023 on one hand? O_o
    $endgroup$
    – ASCII-only
    17 mins ago










  • $begingroup$
    BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
    $endgroup$
    – ASCII-only
    5 mins ago














3












3








3





$begingroup$


For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of a problem when we get to the number four. Specifically, it requires us to put up our middle finger, which results in a rather unfortunate gesture, which is not typically accepted in society. This type of number is a rude number. We come to the next rude number at 36, when we raise the thumb on our second hand and the middle finger of our first hand. The definition of a rude number is any number that, under this system of counting, results in us putting up only the middle finger of any hand. Once we pass 1023 (the maximum number reachable on one hand), assume we continue with a third hand, with additional hands added as required.



Your Task:



Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a rude number.



Input:



An integer between 0 and 10^9 (inclusive).



Output:



A truthy/falsy value that indicates whether the input is a rude number.



Test Cases:



Input:    Output:
0 ---> falsy
3 ---> falsy
4 ---> truthy
25 ---> falsy
36 ---> truthy
127 ---> falsy
131 ---> truthy


Scoring:



This is code-golf, so the lowest score in bytes wins.










share|improve this question











$endgroup$




For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of a problem when we get to the number four. Specifically, it requires us to put up our middle finger, which results in a rather unfortunate gesture, which is not typically accepted in society. This type of number is a rude number. We come to the next rude number at 36, when we raise the thumb on our second hand and the middle finger of our first hand. The definition of a rude number is any number that, under this system of counting, results in us putting up only the middle finger of any hand. Once we pass 1023 (the maximum number reachable on one hand), assume we continue with a third hand, with additional hands added as required.



Your Task:



Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a rude number.



Input:



An integer between 0 and 10^9 (inclusive).



Output:



A truthy/falsy value that indicates whether the input is a rude number.



Test Cases:



Input:    Output:
0 ---> falsy
3 ---> falsy
4 ---> truthy
25 ---> falsy
36 ---> truthy
127 ---> falsy
131 ---> truthy


Scoring:



This is code-golf, so the lowest score in bytes wins.







code-golf number decision-problem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 44 mins ago







Gryphon

















asked 1 hour ago









GryphonGryphon

3,1891963




3,1891963








  • 2




    $begingroup$
    assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
    $endgroup$
    – Veskah
    1 hour ago






  • 1




    $begingroup$
    @Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    You can reach 1023 on one hand? O_o
    $endgroup$
    – ASCII-only
    17 mins ago










  • $begingroup$
    BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
    $endgroup$
    – ASCII-only
    5 mins ago














  • 2




    $begingroup$
    assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
    $endgroup$
    – Veskah
    1 hour ago






  • 1




    $begingroup$
    @Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
    $endgroup$
    – Gryphon
    1 hour ago










  • $begingroup$
    You can reach 1023 on one hand? O_o
    $endgroup$
    – ASCII-only
    17 mins ago










  • $begingroup$
    BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
    $endgroup$
    – ASCII-only
    5 mins ago








2




2




$begingroup$
assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
$endgroup$
– Veskah
1 hour ago




$begingroup$
assume we continue with a third hand, When it comes to being rude, teamwork makes the dream work.
$endgroup$
– Veskah
1 hour ago




1




1




$begingroup$
@Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
$endgroup$
– Gryphon
1 hour ago




$begingroup$
@Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers.
$endgroup$
– Gryphon
1 hour ago












$begingroup$
Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
$endgroup$
– Gryphon
1 hour ago




$begingroup$
Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great.
$endgroup$
– Gryphon
1 hour ago












$begingroup$
You can reach 1023 on one hand? O_o
$endgroup$
– ASCII-only
17 mins ago




$begingroup$
You can reach 1023 on one hand? O_o
$endgroup$
– ASCII-only
17 mins ago












$begingroup$
BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
$endgroup$
– ASCII-only
5 mins ago




$begingroup$
BTW, pretty sure there is no short equation for this sequence, but you could (kinda) make a separate equation for each hand
$endgroup$
– ASCII-only
5 mins ago










5 Answers
5






active

oldest

votes


















3












$begingroup$


JavaScript (SpiderMonkey), 27 bytes





x=>/4/.test(x.toString(32))


Try it online!



This is a trivial solution, you just want to convert to base 32 and check if there is a 4 in it.






share|improve this answer









$endgroup$





















    2












    $begingroup$

    Ruby, 36 19 bytes





    ->n{n.to_s(32)[?4]}


    Try it online!



    Saved 17 bytes with @tsh's method.






    share|improve this answer











    $endgroup$













    • $begingroup$
      This returns true for 2207, which has a binary representation of 100010011111
      $endgroup$
      – Embodiment of Ignorance
      29 mins ago










    • $begingroup$
      @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
      $endgroup$
      – Doorknob
      23 mins ago










    • $begingroup$
      I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
      $endgroup$
      – tsh
      19 mins ago












    • $begingroup$
      @tsh because I'm not as clever as you :)
      $endgroup$
      – Doorknob
      16 mins ago










    • $begingroup$
      Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
      $endgroup$
      – Embodiment of Ignorance
      11 mins ago



















    2












    $begingroup$


    Perl 6, 16 bytes





    {.base(32)~~/4/}


    Try it online!



    Checks if there is a 4 in the base 32 representation of the number. Returns either Nil as false or a Match containing a 4.



    You can prove this by the fact that $2^5 = 32$ so each digit is the state of each hand.






    share|improve this answer









    $endgroup$





















      1












      $begingroup$

      Regex (ECMAScript), 37 bytes



      ^((?=(x+)(2{31}x*))3)*(x{32})*x{4}$



      Try it online!



      ^
      (
      (?=(x+)(2{31}x*)) # 2 = floor(tail / 32); 3 = tool to make tail = 2
      3 # tail = 2
      )* # Loop the above as many times as necessary to make
      # the below match
      (x{32})*x{4}$ # Assert that tail % 32 == 4





      share|improve this answer











      $endgroup$





















        0












        $begingroup$


        Japt, 5 bytes



        sH ø4


        Try it online!



        Explanation



              // Implicit input
        sH // To a base-H (=32) string
        ø // Contains
        4 // 4 (JavaScript interprets this as a string)





        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%2f180481%2fam-i-a-rude-number%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$


          JavaScript (SpiderMonkey), 27 bytes





          x=>/4/.test(x.toString(32))


          Try it online!



          This is a trivial solution, you just want to convert to base 32 and check if there is a 4 in it.






          share|improve this answer









          $endgroup$


















            3












            $begingroup$


            JavaScript (SpiderMonkey), 27 bytes





            x=>/4/.test(x.toString(32))


            Try it online!



            This is a trivial solution, you just want to convert to base 32 and check if there is a 4 in it.






            share|improve this answer









            $endgroup$
















              3












              3








              3





              $begingroup$


              JavaScript (SpiderMonkey), 27 bytes





              x=>/4/.test(x.toString(32))


              Try it online!



              This is a trivial solution, you just want to convert to base 32 and check if there is a 4 in it.






              share|improve this answer









              $endgroup$




              JavaScript (SpiderMonkey), 27 bytes





              x=>/4/.test(x.toString(32))


              Try it online!



              This is a trivial solution, you just want to convert to base 32 and check if there is a 4 in it.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 22 mins ago









              tshtsh

              9,15511650




              9,15511650























                  2












                  $begingroup$

                  Ruby, 36 19 bytes





                  ->n{n.to_s(32)[?4]}


                  Try it online!



                  Saved 17 bytes with @tsh's method.






                  share|improve this answer











                  $endgroup$













                  • $begingroup$
                    This returns true for 2207, which has a binary representation of 100010011111
                    $endgroup$
                    – Embodiment of Ignorance
                    29 mins ago










                  • $begingroup$
                    @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                    $endgroup$
                    – Doorknob
                    23 mins ago










                  • $begingroup$
                    I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                    $endgroup$
                    – tsh
                    19 mins ago












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    16 mins ago










                  • $begingroup$
                    Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                    $endgroup$
                    – Embodiment of Ignorance
                    11 mins ago
















                  2












                  $begingroup$

                  Ruby, 36 19 bytes





                  ->n{n.to_s(32)[?4]}


                  Try it online!



                  Saved 17 bytes with @tsh's method.






                  share|improve this answer











                  $endgroup$













                  • $begingroup$
                    This returns true for 2207, which has a binary representation of 100010011111
                    $endgroup$
                    – Embodiment of Ignorance
                    29 mins ago










                  • $begingroup$
                    @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                    $endgroup$
                    – Doorknob
                    23 mins ago










                  • $begingroup$
                    I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                    $endgroup$
                    – tsh
                    19 mins ago












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    16 mins ago










                  • $begingroup$
                    Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                    $endgroup$
                    – Embodiment of Ignorance
                    11 mins ago














                  2












                  2








                  2





                  $begingroup$

                  Ruby, 36 19 bytes





                  ->n{n.to_s(32)[?4]}


                  Try it online!



                  Saved 17 bytes with @tsh's method.






                  share|improve this answer











                  $endgroup$



                  Ruby, 36 19 bytes





                  ->n{n.to_s(32)[?4]}


                  Try it online!



                  Saved 17 bytes with @tsh's method.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 16 mins ago

























                  answered 1 hour ago









                  DoorknobDoorknob

                  54.9k17115352




                  54.9k17115352












                  • $begingroup$
                    This returns true for 2207, which has a binary representation of 100010011111
                    $endgroup$
                    – Embodiment of Ignorance
                    29 mins ago










                  • $begingroup$
                    @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                    $endgroup$
                    – Doorknob
                    23 mins ago










                  • $begingroup$
                    I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                    $endgroup$
                    – tsh
                    19 mins ago












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    16 mins ago










                  • $begingroup$
                    Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                    $endgroup$
                    – Embodiment of Ignorance
                    11 mins ago


















                  • $begingroup$
                    This returns true for 2207, which has a binary representation of 100010011111
                    $endgroup$
                    – Embodiment of Ignorance
                    29 mins ago










                  • $begingroup$
                    @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                    $endgroup$
                    – Doorknob
                    23 mins ago










                  • $begingroup$
                    I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                    $endgroup$
                    – tsh
                    19 mins ago












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    16 mins ago










                  • $begingroup$
                    Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                    $endgroup$
                    – Embodiment of Ignorance
                    11 mins ago
















                  $begingroup$
                  This returns true for 2207, which has a binary representation of 100010011111
                  $endgroup$
                  – Embodiment of Ignorance
                  29 mins ago




                  $begingroup$
                  This returns true for 2207, which has a binary representation of 100010011111
                  $endgroup$
                  – Embodiment of Ignorance
                  29 mins ago












                  $begingroup$
                  @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                  $endgroup$
                  – Doorknob
                  23 mins ago




                  $begingroup$
                  @EmbodimentofIgnorance That is the correct result, is it not? The second hand is 00100.
                  $endgroup$
                  – Doorknob
                  23 mins ago












                  $begingroup$
                  I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                  $endgroup$
                  – tsh
                  19 mins ago






                  $begingroup$
                  I don't speak Ruby. But why not ->n{n.to_s(32)=~/4/}?
                  $endgroup$
                  – tsh
                  19 mins ago














                  $begingroup$
                  @tsh because I'm not as clever as you :)
                  $endgroup$
                  – Doorknob
                  16 mins ago




                  $begingroup$
                  @tsh because I'm not as clever as you :)
                  $endgroup$
                  – Doorknob
                  16 mins ago












                  $begingroup$
                  Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                  $endgroup$
                  – Embodiment of Ignorance
                  11 mins ago




                  $begingroup$
                  Forgive me if I'm not understanding the question, but isn't the first hand of 2207 10001, the second 00111, and the third 11? None of them have their middle finger only up
                  $endgroup$
                  – Embodiment of Ignorance
                  11 mins ago











                  2












                  $begingroup$


                  Perl 6, 16 bytes





                  {.base(32)~~/4/}


                  Try it online!



                  Checks if there is a 4 in the base 32 representation of the number. Returns either Nil as false or a Match containing a 4.



                  You can prove this by the fact that $2^5 = 32$ so each digit is the state of each hand.






                  share|improve this answer









                  $endgroup$


















                    2












                    $begingroup$


                    Perl 6, 16 bytes





                    {.base(32)~~/4/}


                    Try it online!



                    Checks if there is a 4 in the base 32 representation of the number. Returns either Nil as false or a Match containing a 4.



                    You can prove this by the fact that $2^5 = 32$ so each digit is the state of each hand.






                    share|improve this answer









                    $endgroup$
















                      2












                      2








                      2





                      $begingroup$


                      Perl 6, 16 bytes





                      {.base(32)~~/4/}


                      Try it online!



                      Checks if there is a 4 in the base 32 representation of the number. Returns either Nil as false or a Match containing a 4.



                      You can prove this by the fact that $2^5 = 32$ so each digit is the state of each hand.






                      share|improve this answer









                      $endgroup$




                      Perl 6, 16 bytes





                      {.base(32)~~/4/}


                      Try it online!



                      Checks if there is a 4 in the base 32 representation of the number. Returns either Nil as false or a Match containing a 4.



                      You can prove this by the fact that $2^5 = 32$ so each digit is the state of each hand.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered 13 mins ago









                      Jo KingJo King

                      23.7k257123




                      23.7k257123























                          1












                          $begingroup$

                          Regex (ECMAScript), 37 bytes



                          ^((?=(x+)(2{31}x*))3)*(x{32})*x{4}$



                          Try it online!



                          ^
                          (
                          (?=(x+)(2{31}x*)) # 2 = floor(tail / 32); 3 = tool to make tail = 2
                          3 # tail = 2
                          )* # Loop the above as many times as necessary to make
                          # the below match
                          (x{32})*x{4}$ # Assert that tail % 32 == 4





                          share|improve this answer











                          $endgroup$


















                            1












                            $begingroup$

                            Regex (ECMAScript), 37 bytes



                            ^((?=(x+)(2{31}x*))3)*(x{32})*x{4}$



                            Try it online!



                            ^
                            (
                            (?=(x+)(2{31}x*)) # 2 = floor(tail / 32); 3 = tool to make tail = 2
                            3 # tail = 2
                            )* # Loop the above as many times as necessary to make
                            # the below match
                            (x{32})*x{4}$ # Assert that tail % 32 == 4





                            share|improve this answer











                            $endgroup$
















                              1












                              1








                              1





                              $begingroup$

                              Regex (ECMAScript), 37 bytes



                              ^((?=(x+)(2{31}x*))3)*(x{32})*x{4}$



                              Try it online!



                              ^
                              (
                              (?=(x+)(2{31}x*)) # 2 = floor(tail / 32); 3 = tool to make tail = 2
                              3 # tail = 2
                              )* # Loop the above as many times as necessary to make
                              # the below match
                              (x{32})*x{4}$ # Assert that tail % 32 == 4





                              share|improve this answer











                              $endgroup$



                              Regex (ECMAScript), 37 bytes



                              ^((?=(x+)(2{31}x*))3)*(x{32})*x{4}$



                              Try it online!



                              ^
                              (
                              (?=(x+)(2{31}x*)) # 2 = floor(tail / 32); 3 = tool to make tail = 2
                              3 # tail = 2
                              )* # Loop the above as many times as necessary to make
                              # the below match
                              (x{32})*x{4}$ # Assert that tail % 32 == 4






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited 16 mins ago

























                              answered 23 mins ago









                              DeadcodeDeadcode

                              1,7241419




                              1,7241419























                                  0












                                  $begingroup$


                                  Japt, 5 bytes



                                  sH ø4


                                  Try it online!



                                  Explanation



                                        // Implicit input
                                  sH // To a base-H (=32) string
                                  ø // Contains
                                  4 // 4 (JavaScript interprets this as a string)





                                  share|improve this answer









                                  $endgroup$


















                                    0












                                    $begingroup$


                                    Japt, 5 bytes



                                    sH ø4


                                    Try it online!



                                    Explanation



                                          // Implicit input
                                    sH // To a base-H (=32) string
                                    ø // Contains
                                    4 // 4 (JavaScript interprets this as a string)





                                    share|improve this answer









                                    $endgroup$
















                                      0












                                      0








                                      0





                                      $begingroup$


                                      Japt, 5 bytes



                                      sH ø4


                                      Try it online!



                                      Explanation



                                            // Implicit input
                                      sH // To a base-H (=32) string
                                      ø // Contains
                                      4 // 4 (JavaScript interprets this as a string)





                                      share|improve this answer









                                      $endgroup$




                                      Japt, 5 bytes



                                      sH ø4


                                      Try it online!



                                      Explanation



                                            // Implicit input
                                      sH // To a base-H (=32) string
                                      ø // Contains
                                      4 // 4 (JavaScript interprets this as a string)






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered 18 mins ago









                                      ASCII-onlyASCII-only

                                      3,4601236




                                      3,4601236






























                                          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%2f180481%2fam-i-a-rude-number%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

                                          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                                          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

                                          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...