[Question]
  [
**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 | Binary  | Explanation
--------------------------------------
0     | truthy | 0       | only one zero at "center"
1     | falsy  | 1       | contains no zeroes
5     | truthy | 101     | only one zero at center
9     | falsy  | 1001    | contains two zeroes (even though both are at the center)
10    | falsy  | 1010    | contains two zeroes
27    | truthy | 11011   | only one zero at center
85    | falsy  | 1010101 | contains three zeroes
101   | falsy  | 1100101 | contains three zeroes
111   | falsy  | 1101111 | only one zero, not at center
119   | truthy | 1110111 | only one zero at center
```
**Input:**
* An integer or equivalent types. (`int`, `long`, `decimal`, etc.)
* Assume that if evaluating the input results in an integer overflow or other undesirable problems, then that input doesn't have to be evaluated.
**Output:**
* Truthy or falsy.
* Truthy/falsy output must meet the used language's specifications for truthy/falsy. (e.g. C has `0` as false, non-zero as true)
**Challenge Rules:**
* Input that is less than 0 is assumed to be falsy and thus does not have to be evaluated.
* 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](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answers in bytes wins!.
* [Default loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* [Standard rules](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) apply for your answer with [default I/O rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/).
---
This is my first **Programming Puzzles & Code Golf** challenge, so any feedback on how I should improve would be much appreciated!
  
[Answer]
# [Python 2](https://docs.python.org/2/), 30 bytes
```
lambda n:(2*n^2*n+3)**2==8*n+9
```
[Try it online!](https://tio.run/##DcZLCoAgEADQ/ZzCpVqLZiL64U0iMEoSapIwotObiwcvfHG/mJIzUzrsuaxW8CBJ85wVtdKajOly@/Tu/tgEDmw8hydKNYbbcxRcOskqVYBA0AASUAtdToWA2P8 "Python 2 – Try It Online")
Note that `2*n^2*n+3` is the bitwise xor of `2*n` and `2*n+3`, because that's Python's operator precedence.
[Answer]
# x86 Machine Code, 17 bytes
```
8D 47 01 31 F8 89 C2 F7 D2 0F AF C2 8D 44 78 02 C3
```
The above bytes define a function that accepts a 32-bit integer input value (in the `EDI` register for this example, following a common System V calling convention, but you could actually pick pretty much any input register you wanted without affecting the size of the resulting code), and returns a result (in the `EAX` register) indicating whether the input value is a Cyclops number.
The input is assumed to be an unsigned integer, since the challenge rules state that we can ignore negative values.
The decision logic is borrowed from [Neil's answer](https://codegolf.stackexchange.com/a/181156): since a Cyclops number has the form \$ n = (2 ^ k + 1) (2 ^ { k - 1 } - 1) \$, we can use a series of bit-twiddling operations to check the input.
*Note:* The return value is truthy/falsy, but the semantics are reversed, such that the function will return falsy for a Cyclops number. I claim this is legal because machine code doesn't have "specifications for truthy/falsy", which is the requirement in the question. (See below for an alternative version if you think this is cheating.)
In assembly language mnemonics, this is:
```
; EDI = input value
; EAX = output value (0 == Cyclops number)
8D 47 01           lea    eax, [edi + 1]          ; \ EAX = ((EDI + 1) ^ EDI)
31 F8              xor    eax, edi                ; /
89 C2              mov    edx, eax                ; \ EDX = ~EAX
F7 D2              not    edx                     ; /
0F AF C2           imul   eax, edx                ; EAX *= EDX
8D 44 78 02        lea    eax, [eax + edi*2 + 2]  ; EAX  = (EAX + (EDI * 2) + 2)
C3                 ret                            ; return, with EAX == 0 for Cyclops number
```
**[Try it online!](https://tio.run/##jZLfa8IwEMff@1ccGUIqOmvH2M86RPfgyxh72oMgsY0alibSJOIY/uvr0tYWdZaal9K7zzf3vbuE3WUYpldMhNxEFJ6VjuZS8uvVwDkKMmlDqRGKLQWNYKJG3yGXa/Vm4jlNcJXYEG6o6/w4YE8VTagyXD/lwdmMqHg2w2iqOSXcRvq41aIRcztgv2Q7FSgHy2PBrUwyMMfqqVhuoKDINqeic5SQurzrXJrFhvN9ur7U3rmPD4pZZ35ND4@AAoIAF3NwAXptkEavjbajWTKlaQJMwevwE9q9E@EYAeBirJALmch0x8Lx5L8w6wBVASusFHZzc7s14PYXToRusaWEapOIanG7dCNZBKMVDb@KlQ9F9J4woT9youYBrDNigVGLTXUwgJayc@kcVsvpowjGp29r33sQgOfCC6CwyKKsR7tMKP9da33nOLYixIQJXJqoN@3tm60n@o3EbfMdzZf0/UbEv2tE7i/w4l1g5hLD/QfLHL4ULxt@@hsuOFmqtBvf@H8 "C (gcc) – Try It Online")**
---
As promised, if you think it's cheating to invert the semantics of truthy/falsy even in machine code where there are no real standards or conventions, then add three more bytes, for a total of **21 bytes**:
```
; EDI = input value
; AL  = output value (1 == Cyclops number)
8D 47 01           lea    eax, [edi + 1]          ; \ EAX = ((EDI + 1) ^ EDI)
31 F8              xor    eax, edi                ; /
89 C2              mov    edx, eax                ; \ EDX = ~EAX
F7 D2              not    edx                     ; /
0F AF C2           imul   eax, edx                ; EAX *= EDX
8D 44 78 01        lea    eax, [eax + edi*2 + 1]  ; EAX  = (EAX + (EDI * 2) + 1)
40                 inc    eax                     ; EAX += 1
0F 94 C0           setz   al                      ; AL = ((EAX == 0) ? 1 : 0)
C3                 ret                            ; return, with AL == 1 for Cyclops number
```
The first half of this code is the same as the original (down through the `imul` instruction). The `lea` is almost the same, but instead of adding a constant 2, it only adds a constant 1. That's because the following `inc` instruction increments the value in the `EAX` register by 1 in order to set the flags. If the "zero" flag is set, the `setz` instruction will set `AL` to 1; otherwise, `AL` will be set to 0. This is the standard way that a C compiler will generate machine code to return a `bool`.
Changing the constant added in the `lea` instruction obviously doesn't change the code size, and the `inc` instruction is very small (only 1 byte), but the `setz` instruction is a rather whopping 3 bytes. Unfortunately, I can't think of any shorter way of writing it.
[Answer]
# Regex (ECMAScript), ~~60~~ ~~58~~ ~~57~~ ~~60~~ 58 bytes
The input \$n\$ is in unary, as the length of a string of `x`s.
**SPOILER WARNING**: For the square root, this regex uses a variant of the generalized multiplication algorithm, which is non-obvious and could be a rewarding puzzle to work out on your own. For more information, see an explanation for this form of the algorithm in [Find a Rocco number](https://codegolf.stackexchange.com/questions/179239/find-a-rocco-number/179420#179420).
*-2 bytes by allowing backtracking in the search for \$z\$*  
*-1 byte [thanks to Grimmy](https://chat.stackexchange.com/transcript/message/49371136#49371136), by searching for \$z\$ from smallest to largest instead of vice versa*  
*+3 bytes to handle zero*  
*-2 bytes by moving the square root capture outside the lookahead*
This works by finding \$z\$, a perfect square power of 2 for which \$n=2(n-z)+\sqrt{z}+1\$. Only the largest perfect square power of 2 not exceeding \$n\$ can satisfy this, but due to a golf optimization, the regex tries all of them starting with the smallest. Since each one corresponds to a cyclops number, only the largest one can result in a match.
```
^(x*)(?!(x(xx)+)\2*$)(x(x*))(?=(?=(\4*)\5+$)\4*$\6)x\1$|^$
```
[Try it online!](https://tio.run/##TY89b8IwEIb/CkQR3CVNSBBlwDVMHVgY2rEpkgVH4tY4lm0g5eO3p8lQqdIN773PSafnS5yF21lpfOKM3JM91vqbflrLNV0Gb1S@NgbgypeTqN1CEyGshtBA02CMxTQKsV8i7GreTzGLsHiOQ@xCWMyxKfLwvg3baHLF1Nfv3kpdAqZOyR3B/CmZITLHM3appCIAxS2JvZKaAHHI9UkpvJVcpc4o6WGcjJHJA4DmZapIl77C5fR@l24jNiC5EdbRWnsoP7JPxD9A/4Fe5qt80WP0la0vwVqfhZL7gRW6pMUgiBU71BaYfOHEZBxj9zBogtSSIeFBYnoUfleBRby50ch0Sh56i5yZk3fedifs8WizJM@y7Bc "JavaScript (SpiderMonkey) – Try It Online")
```
^                 # N = tail
(x*)              # tail = Z, with the smallest value that satisfies the following
                  # assertions (which is no different from the largest value that
                  # would satisfy them, since no more than one value can do so);
                  # \1 = N - Z
                   
(?!(x(xx)+)\2*$)  # Assert Z is a power of 2
# Assert Z is a perfect square, and take its square root
(x(x*))           # \4 = square root of Z; \5 = \4 - 1; tail = N - \1 - \4
(?=(\4*)\5+$)     # iff \4*\4 == Z, then the first match here must result in \6==0
(?=\4*$\6)        # test for divisibility by \4 and for \6==0 simultaneously
# Assert that N == \1*2 + \4 + 1. If this fails, then due to a golf optimization,
# the regex engine will backtrack into the capturing of \4, and try all smaller
# values to see if they are the square root of Z; all of these smaller values will
# fail, because the \4*\4==Z multiplication test only matches for one unique value
# of \4.
x\1$
|^$               # Match N==0, because the above algorithm does not
```
[Answer]
# Japt, 8 bytes
```
1¥¢q0 äè
```
[Run it online](https://ethproductions.github.io/japt/?v=1.4.6&code=MaWicTAg5Og=&input=MTE5)
## Explanation:
```
1¥¢q0 äè   
                                                              119
  ¢          // Convert the input into a binary string        "1110111"
   q0        // Split the string on "0"                       ["111","111"]
      ä      // Reduce each item by:                            a     b
       è     //   Seeing how many times a is found in b       [1]
 1¥          // == 1; See if the result equals 1              True                                         
```
The idea is to split the binary string at `0`, which would yield two items if there is only one `0`. Then we see if the first item matches the second to ensure it is palindromic. If the binary string contains multiple `0`s, then the reduce would return a multi-item array and that would fail the `==1` condition. If the binary string does contain one `0`, but is not palindromic, `äè` will return `0` because `b` contains `0` matches of `a`.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 20 bytes
```
p=>~p==(p^=p+1)*~p/2
```
[Try it online!](https://tio.run/##FcdBCoAgEADA72hSaVfbnhKIaWyIu2h09OtWc5vLPa76gnyPmY7QI3SGrTGA4B1YGTk0npceqQgEbXE1@mdRKYlRRIFSesqVUpgSnV/7Cw "JavaScript (Node.js) – Try It Online")
Maybe this is correct, maybe.
Thanks Grimy, 1 byte saved.
---
# [JavaScript (Node.js)](https://nodejs.org), 32 bytes
```
f=(p,q)=>p&1?f(p/2,q+q|2):!(p^q)
```
[Try it online!](https://tio.run/##VYm9CoMwGEX3PMXXpSaosRHsH8RODp36AqUY1GiLTaLGguC7Wwsd9Cz3Hs5LfESXtU9jfaXzYpokx8ZrCI/Nll0kNkHoNW4zhuS8webRkMkChxRdlektjHDr7XyQvwIx@DGCFHU3oOhvtu1tNSAWLmN4WMVjtIxsx5bGTgtL6VvYrMLBPXeDklCp20TMroDHkGnV6bqgtS6xokbkicrxnoALzgjOPBK7ihAyfQE "JavaScript (Node.js) – Try It Online")
---
# [JavaScript (Node.js)](https://nodejs.org), 34 bytes
```
p=>/^(1*)0\1$/.test(p.toString(2))
```
[Try it online!](https://tio.run/##VY89C4MwFEX3/Io3FEwqRiPYj0E3h04dukoxqFGLTYI@C4L/3VrooHe593Cm@5IfORR9a9HTpqwWFS82TvwnFUcWZOLgc6wGpJajeWDf6pqGjC0IMeTkpu2IMMN9xHUQbxci4JcZlOyGiUR/wn7EZiIi3MrwvJOXaCtFILYkrhvK@Vti0VA/K12/ZlyZPpUra4gTKIweTFfxztRUcyvLVJf0xMAFZwZnLUVdzdY3Xw "JavaScript (Node.js) – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 23 bytes
```
{.base(2)~~/^(1*)0$0$/}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwv1ovKbE4VcNIs65OP07DUEvTQMVARb/2vzVXWn6RgkZOZl5qsaZCNRdncWKlgn2ahnaufkyKtr4mV@1/QwUQqFFIS8wpruQyhfJKikpLMiq5DI2QJY3MUSQtTJElDQ0MkXmGlkhKAQ "Perl 6 – Try It Online")
Regex based solution
[Answer]
# [Japt](https://github.com/ETHproductions/japt),  ~~25~~ ~~19~~ ~~10~~ 9 bytes
```
¢êÅ©1¶¢èT
```
*Thanks to @Shaggy for -1 byte*
[Try it online!](https://tio.run/##y0osKPn//9Ciw6sOtx5aaXhoG5C5IuT/fyNzAA "Japt – Try It Online")
[Answer]
# Mathematica (Wolfram language), ~~32~~ 31 bytes
*1 byte saved thanks to J42161217!*
```
OddQ@Log2[#+Floor@Sqrt[#/2]+2]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n6Zg@98/JSXQwSc/3ShaWdstJz@/yCG4sKgkWlnfKFbbKFbtv0t@dEBRZl5JdJ6Crp1CWnRebKyOQnWejoKBjoKxQW3sfwA)
Pure function taking an integer as input and returning `True` or `False`. Based on the fact (fun to prove!) that a number `n` is Cyclops if and only if `n` plus the square root of `n/2` plus `2` rounds down to an odd power of 2. (One can replace `Floor` by either `Ceiling` or `Round` as long as one also replaces `+2` by `+1`.) Returns `True` on input `0`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 24 bytes
```
->x{x+x+2==(1+x^=x+1)*x}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf166iukK7QtvI1lbDULsizrZC21BTq6L2f7ShjoKRjoKpjoIhkDIy11GwALENgMKGhpaxeqmJyRnVNXk1CgWlJcUK0Xk6CoqKadF5sbF6WfmZeRrqCuqatf8B "Ruby – Try It Online")
[Answer]
# Japt, 8 bytes
```
¢ðT ¥¢Êz
```
Thanks to Luis felipe de Jesus Munoz for fixing my submission!
[Try it Online!](https://web.archive.org/web/20190308155149/https://ethproductions.github.io/japt/?v=1.4.6&code=ovBUIKWiyno=&input=MjE=)
# Old regex-based solution, 15 bytes
```
¤f/^(1*)0\1$/ l
```
Returns 1 for true, 0 for false.
[Try it Online!](https://web.archive.org/web/20190308025259/https://ethproductions.github.io/japt/?v=2.0a1&code=pGYvXigxKikwXDEkLyBs&input=Mw==)
[Answer]
# C (gcc), 26 bytes
```
f(n){n=~n==(n^=-~n)*~n/2;}
```
[Try it online!](https://tio.run/##JYrBCsJADETv@xVDQUispUU8CGv@RISyJSUHo5TeSvfX1y3Oad68Sd2cUilKzptLdhHyl3TZ@Zy9v8a9mK94j@bEYQuAfhbQsZkMEfa434YjtbYtVw@YgpSM/wR8l3pXak7T05sLjGPYyw8 "C (gcc) – Try It Online")
Port of [Neil's answer](https://codegolf.stackexchange.com/a/181156/6484). Relies on implementation-defined ordering of operations.
# C++ (clang), 38 bytes
```
int f(int n){return~n==(n^=-~n)*~n/2;}
```
[Try it online!](https://tio.run/##JU1BCsIwELznFUtFSKzVIh6ENL5EhJI0utBuQ0xPpfl6THQOwwyzO6Oda/TY0yslpACWFyax@iEsniIpxempmkjiEOl8kVvaIelxMQN0n2BwPr3vrPxMPRIXbGUAdvbw60HVSsDudm0LsqxrkXMAtMDzlPg7AOfzueXV3jyoOgIKybb0BQ "C++ (clang) – Try It Online")
Can't omit the types in C++, can’t omit the return in clang, otherwise identical.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 thanks to Erik the Outgolfer (use isPalindrome built-in, `ŒḂ`, instead of `⁼Ṛ$`)
```
B¬ŒḂ⁼SƊ
```
A monadic Link accepting an integer which yields `1` (truthy) or `0` (falsey).
**[Try it online!](https://tio.run/##y0rNyan8/9/p0JpHjXse7pylAqSCj3X9///f0NASAA "Jelly – Try It Online")**
### How?
```
B¬ŒḂ⁼SƊ - Link: integer             e.g. 1    9          13         119
B       - to base 2                      [1]  [1,0,0,1]  [1,1,0,1]  [1,1,1,0,1,1,1]
 ¬      - logical NOT (vectorises)       [0]  [0,1,1,0]  [0,0,1,0]  [0,0,0,1,0,0,0]
      Ɗ - last three links as a monad:
  ŒḂ    -   is a palindrome?             1    1          0          1
     S  -   sum                          0    2          1          1
    ⁼   -   equal?                       0    0          0          1
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
ḃD↔Dḍ×ᵐ≠
```
This is a predicate that succeeds if its input is a Cyclops number and fails if its input is not a Cyclops number. Success/failure is the most fundamental truthy/falsey concept in Brachylog.
[Try it online!](https://tio.run/##ASMA3P9icmFjaHlsb2cy///huINE4oaUROG4jcOX4bWQ4omg//8yNw "Brachylog – Try It Online") Or, [find all truthy outputs up to 10000](https://tio.run/##ATkAxv9icmFjaHlsb2cy/zEwMDAw4p@me@KGsOKCguKIpz99y6L/4biDROKGlEThuI3Dl@G1kOKJoP///1g).
### Explanation
```
          Input is an integer
ḃ         Get its binary representation, a list of 1's and 0's
 D        Call that list D
  ↔       When reversed...
   D      It's the same value D
    ḍ     Dichotomize: break the list into two halves
          One of these halves should be all 1's; the other should contain the 0
     ×ᵐ   Get the product of each half
       ≠  Verify that the two products are not equal
```
This succeeds only when given a Cyclops number, because:
* If the binary representation isn't a palindrome, `D↔D` will fail; in what follows, we can assume it's a palindrome.
* If there is more than one zero, both halves will contain at least one zero. So the products will both be zero, and `×ᵐ≠` will fail.
* If there is no zero, both halves will contain only ones. So the products will both be one, and `×ᵐ≠` will fail.
* That leaves the case where there is exactly one zero; since we already know we have a palindrome, this must be the central bit. It will appear in one half, causing that half's product to be zero; the other half will contain all ones, so its product will be one. Then we have 1 ≠ 0, `×ᵐ≠` succeeds, and the whole predicate succeeds.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 8 (or 9) [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
bD0¢sÂQ*
```
[Try it online](https://tio.run/##yy9OTMpM/f8/ycXg0KLiw02BWv//W5gCAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/JINDC10Odxen22j91/kfbapjZK5jaGipY6hjaKRjYapjaGAYCwA).
Returns `1` if truthy; `0` or any positive integer other than `1` as falsey. In 05AB1E only `1` is truthy and everything else is falsey, but I'm not sure if this is an allowed output, or if the output should be two consistent and unique values. If the second, a trailing `Θ` can be added so all outputs other than `1` become `0`:
[Try it online](https://tio.run/##yy9OTMpM/f8/ycXg0KLiw02BWudm/P9vYQoA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/JBeDQ4uKDzcFap2b8V/nf7SpjpG5jqGhpY6hjqGRjoWpjqGBYSwA).
**Explanation:**
```
b     # Convert the (implicit) input-integer to a binary-string
 D    # Duplicate it
  0¢  # Count the amount of 0s
 s    # Swap to get the binary again
  ÂQ  # Check if it's a palindrome
 *    # Multiply both (and output implicitly)
  Θ   # Optionally: check if this is truthy (==1),
      # resulting in truthy (1) or falsey (0)
```
---
An arithmetic approach would be **10 bytes:**
```
LoD<s·>*Iå
```
[Try it online](https://tio.run/##yy9OTMpM/f/fJ9/FpvjQdjstz8NL//@3MAUA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeV/n3wXm@JD2@20Kg8v/a/zP9pUx8hcx9DQUsdQx9BIx8JUx9DAMBYA).
**Explanation:**
Creates a sequences using the algorithm \$a(n) = (2^n-1)\*(2\*2^n+1)\$, and then checks if the input-integer is in this sequence.
```
L        # Create a list in the range [1, (implicit) input-integer]
 o       # For each integer in the list, take 2 to the power this integer
  D<     # Create a copy, and decrease each value by 1
  s·     # Get the copied list again, and double each value
    >    # Then increase each value by 1
  *      # Multiply the numbers at the same indices in both lists
     Iå  # Check if the input-integer is in this list
         # (and output the result implicitly)
```
[Answer]
# [Haskell](https://www.haskell.org/), 32 bytes
```
f n=or[2*4^k-2^k-1==n|k<-[0..n]]
```
[Try it online!](https://tio.run/##DcZBCoAgEADAr@yhU2zhLkUF@RIx6KAk2hbmsb9bh4E59ie6lGr1IPrKhtthix3/SGt549oZ1fdibT33IKDhzkEKNOBDKi6DB6OQkHFEYuQJ5z@KkGix9QM "Haskell – Try It Online")
[Answer]
# Regex (ECMAScript), ~~53~~ 47 bytes
-6 bytes thanks to both Deadcode and Grimy
```
^((?=(x*?)(\2((x+)x(?=\5$))+x$))(?!\2{6})\3x)*$
```
[Try it online!](https://tio.run/##Tc09T8MwFIXhv9JGlXpvQty00A4NbiaGLh1gJCBZya1jcO3INm3ox28PYUBiOcP7DOdDHIWvnGpD6ltVkztY80nfveOGTqNnkk9dC3Dmm1ncvwMUHLq4QCgXAF2C3RDK5QQx6YaBYlwuLqsblvcdxpM@np2RBfsSnDISkHmtKoLVXfqAmJ8apQlAc0ei1soQII65@dIaL5Jr5lutAkzTKeZqD2C4ZJqMDA1uFter8juxA8Vb4TxtTQD5mr0h/gH9B7OZF/P1L2NonD1FW3MUWtUjJ4yk9ShKdL63DnL1yClXSYLDYdRFzFFLIoBCdhChasAhVtZ4q4lpK4ee3/osXWbZDw "JavaScript (SpiderMonkey) – Try It Online")
*explanation by [Deadcode](https://codegolf.stackexchange.com/users/17216/deadcode)*
This regex takes its input in unary, as a sequence of `x` characters in which the length represents the number. Properties of its binary representation are handled indirectly, by doing math on its unary representation.
It works by looping the following operation, which is a subtraction at every step:
* Trim the leftmost and rightmost `1` from the number's binary representation, if the `1` being trimmed from the left is immediately followed by another `1` or the full number is `101`
If and only if the initial input was a cyclops number, it will be the next smallest cyclops number at every step of the loop, e.g. `1110111` → `11011` → `101` → `0`. The regex matches if and only if the value is `0` at the end.
```
^                              # tail = N, the input number
(                              # While tail is odd and is >= 3, and has a leftmost "11"
                               # in its binary representation, trim off the leftmost and
                               # rightmost 1 from its binary representation. If it is a
                               # cyclops number, it will be the next smaller cyclops
                               # number on the next iteration.
    (?=
        (x*?)                  # Find the smallest \2 such that tail - 2*\2 satisfies the
                               # following assertion, i.e. that tail - 2*\2 = 2^k-1
                               # where k >= 2. In other words, assert tail is odd, and
                               # let \2 = (tail - 2^k + 1) / 2, where 2^k-1 has the
                               # largest value of k such that 2^k-1 <= tail. If tail is
                               # a cyclops number, then \2-1 will be the next smallest
                               # cyclops number;
                               # tail -= \2
        (                      # \3 = tool to make tail-1 = \2-1 (will be used later)
            \2                 # tail -= \2
            ((x+)x(?=\5$))+x$  # Assert tail = 2^k-1 where k >= 2
        )
    )
    (?!\2{6})                  # Assert that tail < 6*\2, which is a way of asserting
                               # that in tail's binary representation, the next 1 to the
                               # right of the one we'll be trimming is also 1. This
                               # prevents for example, trimming 10110111 -> 11011, which
                               # would give us a false positive. As a worst case example,
                               # let's say tail = 0b101111111111111111111111111111111111
                               # this would give us:
                               #             \2 = 0b001000000000000000000000000000000000
                               #           6*\2 = 0b110000000000000000000000000000000000
                               # So it's not quite exactly asserting that tail begins
                               # with "11" in its binary representation, and would
                               # continue looping in that case, but that doesn't matter
                               # because that number could never be trimmed into a
                               # cyclops number anyway. With any smaller value of tail
                               # that passes the other tests, we'd have:
                               #           tail = 0b101111111111111111111111111111111101
                               #             \2 = 0b000111111111111111111111111111111111
                               #           6*\2 = 0b101111111111111111111111111111111010
                               # and in this case tail >= 6*\2, so it stops the loop.
                               # On the other end of the scale is 0b101, which needs to
                               # be trimmed even though it doesn't have two leftmost 1
                               # bits in a row. And indeed, that works:
                               #           tail = 0b101
                               #             \2 = 0b001
                               #           6*\2 = 0b110
                               # In this case, it is just barely true that tail < 6*\2
                               # and the loop is allowed to continue one more step.
    \3x                        # tail = \2-1
)*
$                              # Assert that tail = 0 after the loop finished. This will
                               # be true iff N is a cyclops number. If it fails to match,
                               # backtracking cannot make it match, because everything in
                               # the loop is atomic.
```
[Answer]
## Batch, ~~39~~ 37 bytes
```
@cmd/cset/a"m=%1^-~%1,!(m/2*(m+2)-%1)
```
Explanation: A Cyclops number has the form \$ n = (2 ^ k + 1) (2 ^ { k - 1 } - 1) \$. The bitwise XOR then results in \$ m = 2 ^ k - 1 \$ from which we can recalculate \$ n = \lfloor \frac m 2 \rfloor ( m + 2 ) \$. This can then be used to test whether \$ n \$ was a Cyclops number.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~27~~ 24 bytes
Convert to binary and check with a regex. Returns `0` if true, `nil` if false.
-3 bytes thanks to [GB](https://codegolf.stackexchange.com/users/18535/g-b).
```
->n{"%b"%n=~/^(1*)0\1$/}
```
[Try it online!](https://tio.run/##KypNqvyfZhvzX9cur1pJNUlJNc@2Tj9Ow1BL0yDGUEW/9n@0oY6CkY6CqY6CIZAyMtdRsACxDYDChoaWsXqpickZ1TV5NQoFpSXFCtF5OgqKimnRebGxeln5mXka6grqmrX/AQ "Ruby – Try It Online")
For two bytes more, there's a direct port of the Python solution:
```
->n{(2*n^2*n+3)**2==8*n+9}
```
[Answer]
## Excel, ~~97~~ 63 Bytes
```
=A1=2*4^(ROUND(LOG(A1,4),0))-2^(ROUND(LOG(A1,4),0))-1
```
Calculates 2 numbers: 
> 
> Twice the nearest Power of 4  
> 
> `>Num|Binary|2*Power4|Binary`  
> 
> `> 1| 1| 2* 1= 2| 10`  
> 
> `> 2| 10| 2* 4= 8| 1000`  
> 
> `> 4| 100| 2* 4= 8| 1000`  
> 
> `> 20| 10100| 2*16=32|100000` 
> 
> 
> 
  
> 
> 1 Plus the square root of the nearest Power of 4  
> 
> `>Num|Binary|1+√Power4|Binary`  
> 
> `> 1| 1|1+ √1= 2| 10`  
> 
> `> 2| 10|1+ √4= 3| 11`  
> 
> `> 4| 100|1+ √4= 3| 11`  
> 
> `> 20| 10100|1+ √16= 5| 101` 
> 
> 
> 
Then subtract the second number from the first:
> 
> `>Num|Binary|2*Power4|Binary|1+√Power4|Binary|a-b|Binary`  
> 
> `> 1| 1| 2* 1= 2| 10|1+ √1= 2| 10| 0| 0`  
> 
> `> 2| 10| 2* 4= 8| 1000|1+ √4= 3| 11| 5| 101`  
> 
> `> 4| 100| 2* 4= 8| 1000|1+ √4= 3| 11| 5| 101`  
> 
> `> 20| 10100| 2*16=32|100000|1+ √16= 5| 101| 27| 11011` 
> 
> 
> 
And compare this result with the original number
**Old Method**
```
=DEC2BIN(A1)=REPLACE(REPT("1",1+2*INT(IFERROR(LOG(A1,2),0)/2)),1+IFERROR(LOG(A1,2),0)/2,1,"0")
```
Start with the Log-base-2 of A1 and round it down the nearest even number, then add 1. 
Next create a string of that many `"1"`s, and replace the middle character with a `"0"` to create a Cyclops number with a binary length that is always odd, and the same as or 1 less than the binary length of A1
Then, compare it with the Binary representation of A1
[Answer]
# [R](https://www.r-project.org/), ~~37~~ 33 bytes
```
(x=scan())%in%(2*4^(n=0:x)-2^n-1)
```
[Try it online!](https://tio.run/##K/r/X6PCtjg5MU9DU1M1M09Vw0jLJE4jz9bAqkJT1yguT9dQ87@hoeV/AA "R – Try It Online")
R doesn't have a built-in for converting to binary, so I simply used one of the formulae from OEIS to calculate a list of terms from the sequence. 
`n<-0:x` generates a generous list of starting values. `2*4^(n<-0:x^2)-2^n-1)` is the formula from OEIS, and then it checks whether the input appears in that sequence using `%in%`.
-2 bytes by not having to handle negative inputs. -2 bytes by remembering I can change `<-` to `=`.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~29 28~~ 27 bytes
*Saved 1 byte thanks to @ceilingcat*
A port of the [21-byte JS answer by @tsh](https://codegolf.stackexchange.com/a/181134/58563).
```
f(p){p=2*~p==~(p=-~p^p)*p;}
```
[Try it online!](https://tio.run/##JcpBCsIwEEbhfU/xUxBmWgMiiIuYm4hQolMCOg5VcFGSoxsD7h58L7o5xlqFjFcL@6FYCIUsuGIX48F8ro8pKTHWDpDnQknf0LDzUJxwuB1bjOOfgSQkpMywpX1C/eZ61n4LZd88d7l@o9yn@VXd5wc "C (gcc) – Try It Online")
[Answer]
# [J](http://jsoftware.com/), ~~22~~ ~~19~~  ~~17~~  ~~15~~ 14 bytes
-3 bytes thanks to BolceBussiere !
-4 bytes thanks to ngn!
-1 byte thanks to Traws! 
# [J](http://jsoftware.com/), 14 bytes
```
1=1#.(*:|.)@#:
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DW0NlfU0tKxq9DQdlK3@a3IpcKUmZ@QrpCkYwhimcBEjGMvIHMayQMgawHUYGlr@BwA "J – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
BŒḂaB¬S=1
```
[Try it online!](https://tio.run/##y0rNyan8/9/p6KSHO5oSnQ6tCbY1/P@ocYfCo4Y5unaPGuYqADmH24HkdpAQUIDrcPujpjX//0cb6pjqGBrpGJnrWAAZBoY6hoaWsQA "Jelly – Try It Online")
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 22 bytes
```
{Flip@_=_∧1=0~_}@Bin
```
[Try it online!](https://tio.run/##SywpSUzOSP2fpmBlq/C/2i0ns8Ah3jb@UcdyQ1uDuvhaB6fMvP9@qakpxdEqBQXJ6bFcAUWZeSUhqcUlzonFqcXRaToK0QY6CoY6CqZAEkgZGukoGJnrKFiA@AYgAUPL2Nj/AA "Attache – Try It Online")
## Alternatives
**27 bytes:** `{BitXor[2*_,2*_+3]^2=8*_+9}`
**27 bytes:** `{BitXor@@(2*_+0'3)^2=8*_+9}`
**27 bytes:** `{Palindromic@_∧1=0~_}@Bin`
**28 bytes:** `{BitXor[...2*_+0'3]^2=8*_+9}`
**28 bytes:** `{BitXor[…2*_+0'3]^2=8*_+9}`
**28 bytes:** `{Same@@Bisect@_∧1=0~_}@Bin`
**29 bytes:** `{_[#_/2|Floor]=0∧1=0~_}@Bin`
**30 bytes:** `Same@Bin@{_+2^Floor[Log2@_/2]}`
**30 bytes:** `{_[#_/2|Floor]=0and 1=0~_}@Bin`
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~38~~ 37 bytes
```
.+
$*
+`^(1+)\1
$+0
10
1
^((1+)0\2)?$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX0@bS0WLSzshTsNQWzPGkEtF24DLEIi44jRAIgYxRpr2Kv//g0RMuQwNuQyNuIzMuSyAbAMgByRgaAkA "Retina 0.8.2 – Try It Online") Link includes test cases. Edit: After clarification, previous solution didn't handle zero correctly. Explanation:
```
.+
$*
```
Convert from decimal to unary.
```
+`^(1+)\1
$+0
10
1
```
Convert from unary to binary, using the method from the Retina wiki.
```
^((1+)0\2)?$
```
Check for the same number of `1`s before and after the `0`, or an empty string (which is how the above conversion handles zero).
[Answer]
# [PHP](https://php.net/), 74 bytes
```
function($x){return($c=strlen($a=decbin($x)))&1&&trim($a,1)===$a[$c/2|0];}
```
[Try it online!](https://tio.run/##XVBda4MwFH02v@JSgjYgzEid7VzWp409DOZ7V0qaRRRclSTCoOtvd0lrO12ezj1fl5u2bPvHdVu2gAUw6IvuIEzVHOb4mxyVNJ2yUDBtVC0t4uxTin11lgnxqe8bVX1ZPqSEMYb5Bou7@CfaZqc@QwgbqY22vRvkRcCewKhOhsijDhe81m5IxsJEofFoguHR1dgSp6P0Mpmko2nZv@5Lz3VvtLqnl65b8x81mGK6SBdJtExvSbS1RxaNklyUcxiu5doi58AKCByRJ0XZWCqE2YeZhZZ2P42FCwA5s9Z8FZiLrSHIudYBPEDwwqs6CCF/zXfP728ZOvW/ "PHP – Try It Online")
Or **61 bytes** using Arrow syntax:
```
fn($x)=>($c=strlen($a=decbin($x)))&1&trim($a,1)===$a[$c/2|0];
```
[Try it online!](https://tio.run/##XVBPS8MwFD83n@IxwtpAwKSsdrNmOykeBHufQ2JMaKG60kQQ1M9ek63bWnN6v7@Pl7Zq@9tNW7WAjejNR4K/iFgnWAnrukZ7LMWbVq/1QSFkzueuq989TTkRQmC5xeoq/WG7oi8Qwk5bZ0HAFkUMxBpc96kpiniYjWxsANlYmCg8HSEYHl@NLWk@Si@zSZpNy/51H3tOe9nqmh@7zs0XajClfJEvMrbMz0m080eafaelqhIYrpXWT8GBOyDwjSKtqr2nKMye3Yx6WvkfwSYEgBxYbz4JIsQ2EJfS2hhuIL6XdRNTKB/Kl7unxwL99n8 "PHP – Try It Online")
Totally naïve non-mathematical approach, just strings.
```
function cyclops( $x ) {
    $b = decbin( $x );     // convert to binary string (non-zero left padded)
    $l = strlen( $b );     // length of binary string
    $t = trim( $b, 1 );    // remove all 1's on either side
    $m = $b[ $l / 2 |0 ];  // get the middle "bit" of the binary string
    return 
        $l & 1 &&          // is binary string an odd length?
        $t === $m;         // is the middle char of the binary string the same as
                           // string with left and right 1's removed? (can only be '0')
}
```
Or **60 bytes** based on @Chronocidal's algorithm [above](https://codegolf.stackexchange.com/questions/181128/is-it-a-cyclops-number-nobody-knows/181173#181173).
```
function($x){return decbin($x)==str_pad(0,log($x,2)|1,1,2);}
```
[Try it online!](https://tio.run/##XZBRa4MwFIWfza@4lIAKeTBSZzvr@rSxh8F8X0fJ0lgF0ZBEGHT97S5pbafLS@4995wv3MhKDputrCRgDjkMZd9yU3dtgL/DkxKmVy0cBP@qL0qea6P2kh2CiDTd0UokDn8oofbKzkOGEDZCG21JH8iLIH8Co3pBkEddXbJGuyaZDmYTGk86GA9dTy1xOkmvklk6msP@sa@c27vR@oFeWXfynzSaYrpMl0m0Su9J9GmXLDslGK8CGLdl2lbOgRWEcEKe4FVnJQKLnVkQK7u/xdwFILyo1nwb5C62Bb9gWvvwCP4LqxufQPFa7J/f3zJ0Hn4B "PHP – Try It Online")
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 17 bytes
```
ĐļƖĐ⁺2⇹^⇹ᵮ₂2⇹^-⁻=
```
[Try it online!](https://tio.run/##K6gs@f//yIQje45NOzLhUeMuo0ftO@OA@OHWdY@amsA83UeNu23//zcyBwA "Pyt – Try It Online")
No string manipulation required
```
ĐļƖĐ⁺2⇹^⇹₂2⇹^-⁻=
```
| Instruction | Stack | Note |
| --- | --- | --- |
| `Đ` | n,n | implicit input (n); duplicate onto stack |
| `ļƖ` | n,k | take base-2 log of n and cast to integer (k) |
| `Đ` | n,k,k | duplicate k on stack |
| `⁺` | n,k,k+1 | increment top of stack |
| `2⇹^` | n,k,2^(k+1) | raise 2 to the k+1 power |
| `⇹` | n,2^(k+1),k | swap the top two items on the stack |
| `ᵮ₂` | n,2^(k+1),k/2 | cast top of stack to float, then divide by 2 |
| `2⇹^` | n,2^(k+1),2^(k/2) | raise 2 to the k/2 power |
| `-⁻` | n,2^(k+1)-2^(k/2)-1 | subtract and decrement |
| `=` | True/False | check for equality; implicit print |
 
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), ~~31~~ ~~35~~ 26 bytes
*-5 thanks to @DLosc*
```
.!5*+2base..-1%=\{0=},,1=&
```
Link includes test cases.
[Try it online!](https://tio.run/##S8/PSStOLsosKPkfbaBgqGCqYKlgaKBgZK5gYQpkGCoYGoKwZWz1fz1FUy1to6TE4lQ9PV1DVduYagPbWh0dQ1u1/7WqeVr/AQ "GolfScript – Try It Online")
# Explanation
```
.!5*+2base..-1%=\{0=},,1=& | whole program
.!5*+                      | if the input is 0, make it 5 (smallest non-zero cyclops number)
     2base..               | push the binary version of the input
            -1%            | push the reversed version of the binary
               =           | is it equal to the non-reversed version?
                \{0=},,    | count the number of zeros 
                       1=  | is it equal to 1?
                         & | are both of the above checks true?
```
[Answer]
# [Thunno](https://github.com/Thunno/Thunno), \$ 8 \log\_{256}(96) \approx \$ 6.58 bytes
```
bDZqs0c=
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72sJKM0Ly9_wYKlpSVpuhYrklyiCosNkm0hXKjogsWGhpYQJgA)
Port of emirps's Vyxal answer.
## [Thunno](https://github.com/Thunno/Thunno) `P`, \$ 9 \log\_{256}(96) \approx \$ 7.41 bytes
```
bD0c1=sZq
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72sJKM0Ly9_abRSgFLsgqWlJWm6FiuTXAySDW2LowohfKjwgsWGhpYQJgA)
Port of Kevin Cruijssen's 05AB1E answer.
#### Explanation
```
bDZqs0c=  # Implicit input
bD        # Convert to binary and duplicate
  Zqs     # Check if it's a palindrome and swap
     0c=  # Is this equal to the count of 0s?
          # Implicit output
```
```
bD0c1=sZq  # Implicit input
bD         # Convert to binary and duplicate
  0c       # Count the number of "0"s in the string
    1=     # Is it equal to 1?
      sZq  # Swap and check if it's a palindrome
           # P flag multiplies them together
           # Implicit output
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
Π:Ḃ=$0O=
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwizqA64biCPSQwTz0iLCIiLCIwXG4xXG41XG45XG4xMFxuMjdcbjg1XG4xMDFcbjExMVxuMTE5Il0=)
Different approach from the other Vyxal answer.
```
Π        # binary of input
  Ḃ=     # the equality of the reversed version of it to itself (0 for non palindrome, 1 for palindrome)
       = # is equal to
 :  $0O  # the count of 0s in itself
```
Could potentially be golfed
]