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

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Explanation of a regular pattern only occuring for prime numbers

Existence of Riemann surface, holomorphic maps

Macro expansion inside href

Why do neural networks need so many training examples to perform?

Square Root Distance from Integers

What makes papers publishable in top-tier journals?

Looking for a specific 6502 Assembler

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?

Globe trotting Grandpa. Where is he going next?

Why is Agricola named as such?

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

What happens when I Twin Life Transference?

Premature ending of generator in list comprehension

What is a DAG (Graph Theory)?

How can I play a serial killer in a party of good PCs?

Can 5 Aarakocra PCs summon an Air Elemental?

What language shall they sing in?

Why is it that Bernie Sanders is always called a "socialist"?

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

Citing paywalled articles accessed via illegal web sharing

How do you catch Smeargle in Pokemon Go?

How do you funnel food off a cutting board?

How to not let the Identify spell spoil everything?



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
    15 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
    3 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
    15 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
    3 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 42 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
    15 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
    3 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
    15 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
    3 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
15 mins ago




$begingroup$
You can reach 1023 on one hand? O_o
$endgroup$
– ASCII-only
15 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
3 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
3 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
      27 mins ago










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










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












    • $begingroup$
      @tsh because I'm not as clever as you :)
      $endgroup$
      – Doorknob
      14 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
      9 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 20 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
                    27 mins ago










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










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












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    14 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
                    9 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
                    27 mins ago










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










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












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    14 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
                    9 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 14 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
                    27 mins ago










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










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












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    14 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
                    9 mins ago


















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










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










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












                  • $begingroup$
                    @tsh because I'm not as clever as you :)
                    $endgroup$
                    – Doorknob
                    14 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
                    9 mins ago
















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




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












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




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












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






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














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




                  $begingroup$
                  @tsh because I'm not as clever as you :)
                  $endgroup$
                  – Doorknob
                  14 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
                  9 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
                  9 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 11 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 14 mins ago

























                              answered 21 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 16 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

                                          Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

                                          Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

                                          How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...