Is it a Cyclops number? “Nobody” knows!#Hashtag_or_notIs it truthy or falsy?Is this a Smith number?Binary...

Sundering Titan and basic normal lands and snow lands

Is this nominative case or accusative case?

Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?

Create chunks from an array

Named nets not connected in Eagle board design

Can a Mimic (container form) actually hold loot?

Can inspiration allow the Rogue to make a Sneak Attack?

What is the oldest European royal house?

Paper published similar to PhD thesis

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

Why do we call complex numbers “numbers” but we don’t consider 2 vectors numbers?

School performs periodic password audits. Is my password compromised?

Why are special aircraft used for the carriers in the United States Navy?

The Key to the Door

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

Practical reasons to have both a large police force and bounty hunting network?

When to use the term transposed instead of modulation?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

How can I be pwned if I'm not registered on the compromised site?

An Undercover Army

The need of reserving one's ability in job interviews

Can a space-faring robot still function over a billion years?

Is there a way to find out the age of climbing ropes?

What does it mean when I add a new variable to my linear model and the R^2 stays the same?



Is it a Cyclops number? “Nobody” knows!


#Hashtag_or_notIs it truthy or falsy?Is this a Smith number?Binary to decimal converterIs this number triangular?Am I divisible by double the sum of my digits?Is the number binary-heavy?Nobody knows GAU NumbersIs it a whole number?How many consecutive descending numbers in my number?













1












$begingroup$


Task:



Given an integer input, figure out whether or not it is a Cyclops Number.



What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one 0 in the center!



Test Cases:



Input | Output
--------------
1 | falsy
5 | truthy
12 | falsy
27 | truthy
85 | falsy
101 | falsy
119 | truthy


Input: An integer or equivalent types. (int, long, decimal, etc.)
Output:




  • Truthy or falsy (e.g. true or false, 0 or 1)..


Challenge Rules:




  • Input that is less than 0 is assumed to be falsy.


  • If the length of the binary representation of the number is even, then the number cannot be a Cyclops number.



General Rules:




  • This is code-golf, so the shortest answers in bytes wins!.


  • Default loopholes are forbidden.


  • Standard rules apply for your answer with default I/O rules.





This is my first Programming Puzzles & Code Golf challenge, so any feedback on how I should improve would be much appreciated!










share|improve this question









New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
    $endgroup$
    – FryAmTheEggman
    1 hour ago










  • $begingroup$
    @SriotchilismO'Zaic thanks for the feedback! I have edited the post.
    $endgroup$
    – Tau
    1 hour ago






  • 1




    $begingroup$
    I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
    $endgroup$
    – FryAmTheEggman
    52 mins ago






  • 1




    $begingroup$
    Note: This is A129868
    $endgroup$
    – tsh
    49 mins ago






  • 2




    $begingroup$
    Should 119 be true?
    $endgroup$
    – Quintec
    32 mins ago
















1












$begingroup$


Task:



Given an integer input, figure out whether or not it is a Cyclops Number.



What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one 0 in the center!



Test Cases:



Input | Output
--------------
1 | falsy
5 | truthy
12 | falsy
27 | truthy
85 | falsy
101 | falsy
119 | truthy


Input: An integer or equivalent types. (int, long, decimal, etc.)
Output:




  • Truthy or falsy (e.g. true or false, 0 or 1)..


Challenge Rules:




  • Input that is less than 0 is assumed to be falsy.


  • If the length of the binary representation of the number is even, then the number cannot be a Cyclops number.



General Rules:




  • This is code-golf, so the shortest answers in bytes wins!.


  • Default loopholes are forbidden.


  • Standard rules apply for your answer with default I/O rules.





This is my first Programming Puzzles & Code Golf challenge, so any feedback on how I should improve would be much appreciated!










share|improve this question









New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
    $endgroup$
    – FryAmTheEggman
    1 hour ago










  • $begingroup$
    @SriotchilismO'Zaic thanks for the feedback! I have edited the post.
    $endgroup$
    – Tau
    1 hour ago






  • 1




    $begingroup$
    I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
    $endgroup$
    – FryAmTheEggman
    52 mins ago






  • 1




    $begingroup$
    Note: This is A129868
    $endgroup$
    – tsh
    49 mins ago






  • 2




    $begingroup$
    Should 119 be true?
    $endgroup$
    – Quintec
    32 mins ago














1












1








1





$begingroup$


Task:



Given an integer input, figure out whether or not it is a Cyclops Number.



What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one 0 in the center!



Test Cases:



Input | Output
--------------
1 | falsy
5 | truthy
12 | falsy
27 | truthy
85 | falsy
101 | falsy
119 | truthy


Input: An integer or equivalent types. (int, long, decimal, etc.)
Output:




  • Truthy or falsy (e.g. true or false, 0 or 1)..


Challenge Rules:




  • Input that is less than 0 is assumed to be falsy.


  • If the length of the binary representation of the number is even, then the number cannot be a Cyclops number.



General Rules:




  • This is code-golf, so the shortest answers in bytes wins!.


  • Default loopholes are forbidden.


  • Standard rules apply for your answer with default I/O rules.





This is my first Programming Puzzles & Code Golf challenge, so any feedback on how I should improve would be much appreciated!










share|improve this question









New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




Task:



Given an integer input, figure out whether or not it is a Cyclops Number.



What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one 0 in the center!



Test Cases:



Input | Output
--------------
1 | falsy
5 | truthy
12 | falsy
27 | truthy
85 | falsy
101 | falsy
119 | truthy


Input: An integer or equivalent types. (int, long, decimal, etc.)
Output:




  • Truthy or falsy (e.g. true or false, 0 or 1)..


Challenge Rules:




  • Input that is less than 0 is assumed to be falsy.


  • If the length of the binary representation of the number is even, then the number cannot be a Cyclops number.



General Rules:




  • This is code-golf, so the shortest answers in bytes wins!.


  • Default loopholes are forbidden.


  • Standard rules apply for your answer with default I/O rules.





This is my first Programming Puzzles & Code Golf challenge, so any feedback on how I should improve would be much appreciated!







code-golf number decision-problem binary






share|improve this question









New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 28 mins ago







Tau













New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









TauTau

1165




1165




New contributor




Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Tau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    $begingroup$
    You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
    $endgroup$
    – FryAmTheEggman
    1 hour ago










  • $begingroup$
    @SriotchilismO'Zaic thanks for the feedback! I have edited the post.
    $endgroup$
    – Tau
    1 hour ago






  • 1




    $begingroup$
    I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
    $endgroup$
    – FryAmTheEggman
    52 mins ago






  • 1




    $begingroup$
    Note: This is A129868
    $endgroup$
    – tsh
    49 mins ago






  • 2




    $begingroup$
    Should 119 be true?
    $endgroup$
    – Quintec
    32 mins ago














  • 1




    $begingroup$
    You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
    $endgroup$
    – FryAmTheEggman
    1 hour ago










  • $begingroup$
    @SriotchilismO'Zaic thanks for the feedback! I have edited the post.
    $endgroup$
    – Tau
    1 hour ago






  • 1




    $begingroup$
    I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
    $endgroup$
    – FryAmTheEggman
    52 mins ago






  • 1




    $begingroup$
    Note: This is A129868
    $endgroup$
    – tsh
    49 mins ago






  • 2




    $begingroup$
    Should 119 be true?
    $endgroup$
    – Quintec
    32 mins ago








1




1




$begingroup$
You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
$endgroup$
– FryAmTheEggman
1 hour ago




$begingroup$
You've essentially made two separate challenges, one a decision problem and one about outputting the next number of a sequence. This will not do what you want, which is invite more answers, but instead put off users who now need to consider three options about what to program before posting. I'd recommend removing the option, and in the future you can try posting to our sandbox first where hopefully you will get helpful feedback before posting. Good luck!
$endgroup$
– FryAmTheEggman
1 hour ago












$begingroup$
@SriotchilismO'Zaic thanks for the feedback! I have edited the post.
$endgroup$
– Tau
1 hour ago




$begingroup$
@SriotchilismO'Zaic thanks for the feedback! I have edited the post.
$endgroup$
– Tau
1 hour ago




1




1




$begingroup$
I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
$endgroup$
– FryAmTheEggman
52 mins ago




$begingroup$
I'd also recommend removing the hard coding restriction. By default solutions would need to handle all cyclops numbers in theory, and there are clearly infinitely many of them, so they couldn't all be hardcoded.
$endgroup$
– FryAmTheEggman
52 mins ago




1




1




$begingroup$
Note: This is A129868
$endgroup$
– tsh
49 mins ago




$begingroup$
Note: This is A129868
$endgroup$
– tsh
49 mins ago




2




2




$begingroup$
Should 119 be true?
$endgroup$
– Quintec
32 mins ago




$begingroup$
Should 119 be true?
$endgroup$
– Quintec
32 mins ago










4 Answers
4






active

oldest

votes


















2












$begingroup$


Japt, 25 19 10 bytes



¢èT ¶1©¢ês


That's more like it...



Checks if there is only one 0 in the binary representation and that the binary representation is a palindrome.



Try it online!






share|improve this answer











$endgroup$













  • $begingroup$
    found an even shorter way, based on your solution :)
    $endgroup$
    – Embodiment of Ignorance
    2 mins ago





















2












$begingroup$

Japt, 8 bytes



¤øT ©¢ês


Based off of Quintec's solution.



Try it Online!



Old regex-based solution, 15 bytes



¤f/^(1*)01$/ l


Returns 1 for true, 0 for false.



Try it Online!






share|improve this answer











$endgroup$













  • $begingroup$
    Well played, I should really learn regular expressions sometime. :) +1
    $endgroup$
    – Quintec
    28 mins ago










  • $begingroup$
    @Quintec Regex is awesome :)
    $endgroup$
    – Embodiment of Ignorance
    27 mins ago










  • $begingroup$
    Update: found shorter way :)
    $endgroup$
    – Quintec
    18 mins ago



















0












$begingroup$


Perl 6, 23 bytes





{.base(2)~~/^(1*)0$0$/}


Try it online!



Regex based solution






share|improve this answer









$endgroup$





















    0












    $begingroup$


    JavaScript (Node.js), 33 bytes





    f=(p,q)=>p%2?f(p>>1,q+q|1):p==q+q


    Try it online!



    This one will report falsy for 0. But the RegExp based one works for 0.






    JavaScript (Node.js), 35 bytes





    p=>p.toString(2).match(/^(1*)01$/)


    Try it online!






    share|improve this answer











    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "200"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Tau is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f181128%2fis-it-a-cyclops-number-nobody-knows%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$


      Japt, 25 19 10 bytes



      ¢èT ¶1©¢ês


      That's more like it...



      Checks if there is only one 0 in the binary representation and that the binary representation is a palindrome.



      Try it online!






      share|improve this answer











      $endgroup$













      • $begingroup$
        found an even shorter way, based on your solution :)
        $endgroup$
        – Embodiment of Ignorance
        2 mins ago


















      2












      $begingroup$


      Japt, 25 19 10 bytes



      ¢èT ¶1©¢ês


      That's more like it...



      Checks if there is only one 0 in the binary representation and that the binary representation is a palindrome.



      Try it online!






      share|improve this answer











      $endgroup$













      • $begingroup$
        found an even shorter way, based on your solution :)
        $endgroup$
        – Embodiment of Ignorance
        2 mins ago
















      2












      2








      2





      $begingroup$


      Japt, 25 19 10 bytes



      ¢èT ¶1©¢ês


      That's more like it...



      Checks if there is only one 0 in the binary representation and that the binary representation is a palindrome.



      Try it online!






      share|improve this answer











      $endgroup$




      Japt, 25 19 10 bytes



      ¢èT ¶1©¢ês


      That's more like it...



      Checks if there is only one 0 in the binary representation and that the binary representation is a palindrome.



      Try it online!







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 21 mins ago

























      answered 46 mins ago









      QuintecQuintec

      1,9781726




      1,9781726












      • $begingroup$
        found an even shorter way, based on your solution :)
        $endgroup$
        – Embodiment of Ignorance
        2 mins ago




















      • $begingroup$
        found an even shorter way, based on your solution :)
        $endgroup$
        – Embodiment of Ignorance
        2 mins ago


















      $begingroup$
      found an even shorter way, based on your solution :)
      $endgroup$
      – Embodiment of Ignorance
      2 mins ago






      $begingroup$
      found an even shorter way, based on your solution :)
      $endgroup$
      – Embodiment of Ignorance
      2 mins ago













      2












      $begingroup$

      Japt, 8 bytes



      ¤øT ©¢ês


      Based off of Quintec's solution.



      Try it Online!



      Old regex-based solution, 15 bytes



      ¤f/^(1*)01$/ l


      Returns 1 for true, 0 for false.



      Try it Online!






      share|improve this answer











      $endgroup$













      • $begingroup$
        Well played, I should really learn regular expressions sometime. :) +1
        $endgroup$
        – Quintec
        28 mins ago










      • $begingroup$
        @Quintec Regex is awesome :)
        $endgroup$
        – Embodiment of Ignorance
        27 mins ago










      • $begingroup$
        Update: found shorter way :)
        $endgroup$
        – Quintec
        18 mins ago
















      2












      $begingroup$

      Japt, 8 bytes



      ¤øT ©¢ês


      Based off of Quintec's solution.



      Try it Online!



      Old regex-based solution, 15 bytes



      ¤f/^(1*)01$/ l


      Returns 1 for true, 0 for false.



      Try it Online!






      share|improve this answer











      $endgroup$













      • $begingroup$
        Well played, I should really learn regular expressions sometime. :) +1
        $endgroup$
        – Quintec
        28 mins ago










      • $begingroup$
        @Quintec Regex is awesome :)
        $endgroup$
        – Embodiment of Ignorance
        27 mins ago










      • $begingroup$
        Update: found shorter way :)
        $endgroup$
        – Quintec
        18 mins ago














      2












      2








      2





      $begingroup$

      Japt, 8 bytes



      ¤øT ©¢ês


      Based off of Quintec's solution.



      Try it Online!



      Old regex-based solution, 15 bytes



      ¤f/^(1*)01$/ l


      Returns 1 for true, 0 for false.



      Try it Online!






      share|improve this answer











      $endgroup$



      Japt, 8 bytes



      ¤øT ©¢ês


      Based off of Quintec's solution.



      Try it Online!



      Old regex-based solution, 15 bytes



      ¤f/^(1*)01$/ l


      Returns 1 for true, 0 for false.



      Try it Online!







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 2 mins ago

























      answered 30 mins ago









      Embodiment of IgnoranceEmbodiment of Ignorance

      1,516123




      1,516123












      • $begingroup$
        Well played, I should really learn regular expressions sometime. :) +1
        $endgroup$
        – Quintec
        28 mins ago










      • $begingroup$
        @Quintec Regex is awesome :)
        $endgroup$
        – Embodiment of Ignorance
        27 mins ago










      • $begingroup$
        Update: found shorter way :)
        $endgroup$
        – Quintec
        18 mins ago


















      • $begingroup$
        Well played, I should really learn regular expressions sometime. :) +1
        $endgroup$
        – Quintec
        28 mins ago










      • $begingroup$
        @Quintec Regex is awesome :)
        $endgroup$
        – Embodiment of Ignorance
        27 mins ago










      • $begingroup$
        Update: found shorter way :)
        $endgroup$
        – Quintec
        18 mins ago
















      $begingroup$
      Well played, I should really learn regular expressions sometime. :) +1
      $endgroup$
      – Quintec
      28 mins ago




      $begingroup$
      Well played, I should really learn regular expressions sometime. :) +1
      $endgroup$
      – Quintec
      28 mins ago












      $begingroup$
      @Quintec Regex is awesome :)
      $endgroup$
      – Embodiment of Ignorance
      27 mins ago




      $begingroup$
      @Quintec Regex is awesome :)
      $endgroup$
      – Embodiment of Ignorance
      27 mins ago












      $begingroup$
      Update: found shorter way :)
      $endgroup$
      – Quintec
      18 mins ago




      $begingroup$
      Update: found shorter way :)
      $endgroup$
      – Quintec
      18 mins ago











      0












      $begingroup$


      Perl 6, 23 bytes





      {.base(2)~~/^(1*)0$0$/}


      Try it online!



      Regex based solution






      share|improve this answer









      $endgroup$


















        0












        $begingroup$


        Perl 6, 23 bytes





        {.base(2)~~/^(1*)0$0$/}


        Try it online!



        Regex based solution






        share|improve this answer









        $endgroup$
















          0












          0








          0





          $begingroup$


          Perl 6, 23 bytes





          {.base(2)~~/^(1*)0$0$/}


          Try it online!



          Regex based solution






          share|improve this answer









          $endgroup$




          Perl 6, 23 bytes





          {.base(2)~~/^(1*)0$0$/}


          Try it online!



          Regex based solution







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 23 mins ago









          Jo KingJo King

          24.4k357126




          24.4k357126























              0












              $begingroup$


              JavaScript (Node.js), 33 bytes





              f=(p,q)=>p%2?f(p>>1,q+q|1):p==q+q


              Try it online!



              This one will report falsy for 0. But the RegExp based one works for 0.






              JavaScript (Node.js), 35 bytes





              p=>p.toString(2).match(/^(1*)01$/)


              Try it online!






              share|improve this answer











              $endgroup$


















                0












                $begingroup$


                JavaScript (Node.js), 33 bytes





                f=(p,q)=>p%2?f(p>>1,q+q|1):p==q+q


                Try it online!



                This one will report falsy for 0. But the RegExp based one works for 0.






                JavaScript (Node.js), 35 bytes





                p=>p.toString(2).match(/^(1*)01$/)


                Try it online!






                share|improve this answer











                $endgroup$
















                  0












                  0








                  0





                  $begingroup$


                  JavaScript (Node.js), 33 bytes





                  f=(p,q)=>p%2?f(p>>1,q+q|1):p==q+q


                  Try it online!



                  This one will report falsy for 0. But the RegExp based one works for 0.






                  JavaScript (Node.js), 35 bytes





                  p=>p.toString(2).match(/^(1*)01$/)


                  Try it online!






                  share|improve this answer











                  $endgroup$




                  JavaScript (Node.js), 33 bytes





                  f=(p,q)=>p%2?f(p>>1,q+q|1):p==q+q


                  Try it online!



                  This one will report falsy for 0. But the RegExp based one works for 0.






                  JavaScript (Node.js), 35 bytes





                  p=>p.toString(2).match(/^(1*)01$/)


                  Try it online!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 9 mins ago

























                  answered 21 mins ago









                  tshtsh

                  9,32511652




                  9,32511652






















                      Tau is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Tau is a new contributor. Be nice, and check out our Code of Conduct.













                      Tau is a new contributor. Be nice, and check out our Code of Conduct.












                      Tau is a new contributor. Be nice, and check out our Code of Conduct.
















                      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%2f181128%2fis-it-a-cyclops-number-nobody-knows%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

                      Fairchild Swearingen Metro Inhaltsverzeichnis Geschichte | Innenausstattung | Nutzung | Zwischenfälle...

                      Pilgersdorf Inhaltsverzeichnis Geografie | Geschichte | Bevölkerungsentwicklung | Politik | Kultur...

                      Marineschifffahrtleitung Inhaltsverzeichnis Geschichte | Heutige Organisation der NATO | Nationale und...