[Question]
  [
**Warning : this is NOT a "hey, let's draw a cake in ASCII-art" challenge! Please keep reading ;)**
Some time ago it was my birthday, I'm 33 now. 
So there is this awkward social tradition consisting in inviting family and friends, putting number-like candles on a cake, sing songs and open gifts.
```
   33   
--------
```
Instead of numbers, I can use the binary system to put standard candles: I place 6 of them on the cake and light two of them.
```
 100001
--------
```
I can see that **both decimal and binary numbers of my age are palindromic!**
# Challenge
I want to know if any other number can be put on a cake with candles and be palindromic, decimal and binary.
Write a program/function to test if a number is palindromic in **both** decimal and binary. But wait, there's more : **in binary, leading zeros count for the test!** 
## Input
A **decimal** number x that I want to test if it is birthday palindromic with 0 < x < 232-1 (yes, the people in my dimension live very long)
## Output
[Truthy](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey) if it meets exactly these two conditions, Falsey else:
* The decimal representation of the number is a standard palindrome
* The binary representation of the number is a standard palindrome, **and adding leading zeros may help with this**
## Test cases
```
1 > 1 => Truthy
6 > 110 (0110) => Truthy
9 > 1001 => Truthy
10 > 1010 (01010) => Falsey, 10 is not palindromic
12 => 1100 (001100) => Falsey, 12 is not palindromic
13 => 1101 (...01101) => Falsey, neither 13 nor 1101 are palindromic
14 => 1110 (01110) => Falsey, 14 is not palindromic
33 > 100001 => Truthy
44 > 101100 (..0101100) => Falsey, 101100 is not palindromic
1342177280 > 1010000000000000000000000000000 (00000000000000000000000000001010000000000000000000000000000) => Falsey, 1342177280 is not palindromic (but the binary representation is)
297515792 > 10001101110111011101100010000 (000010001101110111011101100010000) => Truthy
```
## Rules
* [Standard loopholes are disallowed](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default)
* Built-in library conversions and tests are allowed
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest code win!
Good luck, and eventually happy birthday!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
```
b0Ü‚DíQ
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/yeDwnEcNs1wOrw38/9/YGAA "05AB1E – Try It Online")
or as a [Test Suite](https://tio.run/##MzBNTDJM/V9TVln5P8ng8JxHDbNcDq8N/F@pdHi/lcLh/Uo6/w25zLgsuQwNuAyNuAyNuQxNuIyNuUxMAA)
**Explanation**
```
b         # convert input to binary
 0Ü       # remove trailing zeroes
   ‚      # pair with input
    D     # duplicate
     í    # reverse each (in the copy)
      Q   # check for equality
```
[Answer]
# [Python 3](https://docs.python.org/3/), 59 bytes
```
lambda a:all(c==c[::-1]for c in[str(a),bin(a).strip('0b')])
```
[Try it online!](https://tio.run/##DcdBCoAgEADAr3hzFyoKb4IvMQ@rIQmmYl56/eZpmPaNuxbF0Zyc6fEXCdKUMwRjgtV6PVysXQSRin1HB8LFpzLZ5lIDuXuJDrn1VAZEUAqRfw "Python 3 – Try It Online")
-3 bytes thanks to Rod  
-3 bytes thanks to Connor Johnston
[Answer]
# JavaScript (ES6), 65 bytes
Returns `0` or `1`.
```
n=>(g=b=>[...s=n.toString(b)].reverse().join``==s)()&g(2,n/=n&-n)
```
### How?
The helper function ***g()*** takes an integer ***b*** as input and tests whether ***n*** is a palindrome in base ***b***. If ***b*** is not specified, it just converts ***n*** to a string before testing it.
We get rid of the trailing zeros in the binary representation of ***n*** by isolating the least significant *1* with `n&-n` and dividing ***n*** by the resulting quantity.
Fun fact: it's truthy for `0` because `(0/0).toString(2)` equals `"NaN"`, which is a palindrome. (But `0` is not a valid input anyway.)
### Test cases
```
let f =
n=>(g=b=>[...s=n.toString(b)].reverse().join``==s)()&g(2,n/=n&-n)
console.log(f(1 )) // Truthy
console.log(f(6 )) // Truthy
console.log(f(9 )) // Truthy
console.log(f(10)) // Falsey
console.log(f(12)) // Falsey
console.log(f(13)) // Falsey
console.log(f(14)) // Falsey
console.log(f(33)) // Truthy
console.log(f(44)) // Falsey
```
[Answer]
# Mathematica, ~~52~~ 49 bytes
```
i=IntegerReverse;i@#==#&&!i[#,2,Range@#]~FreeQ~#&
```
[Try it on Wolfram Sandbox](http://sandbox.open.wolframcloud.com)
### Usage
```
f = (i=IntegerReverse;i@#==#&&!i[#,2,Range@#]~FreeQ~#&);
```
---
```
f[6]
```
> 
> `True`
> 
> 
> 
```
f /@ {9, 14, 33, 44}
```
> 
> `{True, False, True, False}`
> 
> 
> 
### Explanation
```
i=IntegerReverse;i@#==#&&!i[#,2,Range@#]~FreeQ~#&
i=IntegerReverse                                   (* Set i to the integer reversing function. *)
                 i@#==#                            (* Check whether the input reversed is equal to input. *)
                       &&                          (* Logical AND *)
                          i[#,2,Range@#]           (* Generate the binary-reversed versions of input, whose lengths *)
                                                   (* (in binary) are `{1..<input>}` *) 
                                                   (* trim or pad 0s to match length *)
                                        ~FreeQ~#   (* Check whether the result is free of the original input *)
                         !                         (* Logical NOT *)
```
### Version with builtin `PalindromeQ`
```
PalindromeQ@#&&!IntegerReverse[#,2,Range@#]~FreeQ~#&
```
[Answer]
# Pyth - 13 bytes
```
&_I.s.BQ`Z_I`
```
[Test Suite](http://pyth.herokuapp.com/?code=%26_I.s.BQ%60Z_I%60&test_suite=1&test_suite_input=1%0A6%0A9%0A10%0A12%0A13%0A14%0A33%0A44&debug=0).
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 14 bytes
```
s ê¬©¢w n2 ¤ê¬
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=cyDqrKmidyBuMiCk6qw=&input=Ng==)
### Explanation
```
 s ê¬ © ¢   w n2 ¤  ê¬
Us êq &&Us2 w n2 s2 êq   Ungolfed
                         Implicit: U = input integer
Us êq                    Convert U to a string and check if it's a palindrome.
        Us2 w            Convert U to binary and reverse. 
              n2 s2      Convert to a number, then back to binary, to remove extra 0s.
                    êq   Check if this is a palindrome.
      &&                 Return whether both of these conditions were met.
```
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 57 bytes
```
a=>(b=c=>c==c[to by-1])(str(a))*b(bin(a)[2to].strip('0'))
```
[Try it online!](https://tio.run/##NYk7DoAgDEB3T@FGa6JRYS0XIQxAQsJCCXbx9Mji9j6ts3AdmUYgC5ES2USUnPAa3/3yCI90CIhbhFjqJHcL@2PW0kCdCnG0XqpABmMQl1@0nucD "Proton – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
Bt0ŒḂaŒḂ
```
[Try it online!](https://tio.run/##y0rNyan8/9@pxODopIc7mhLB5P///01MAA "Jelly – Try It Online")
[Answer]
# APL, 27 31 Bytes
```
∧/(⌽≡⊢)∘⍕¨{⍵,⊂{⍵/⍨∨\⍵}⌽2⊥⍣¯1⊢⍵}
```
How's it work? Using 6 as the argument...
```
      2⊥⍣¯1⊢6 ⍝ get the bit representation
1 1 0
      ⌽2⊥⍣¯1⊢6 ⍝ reverse it (if it's a palindrome, it doesn't matter)
0 1 1
      {⍵/⍨∨\⍵}⌽2⊥⍣¯1⊢6 ⍝ drop off the trailing (now leading 0's)
1 1
      6,⊂{⍵/⍨∨\⍵}⌽2⊥⍣¯1⊢6 ⍝ enclose and concatenate the bits to the original number
┌─┬───┐
│6│1 1│
└─┴───┘
      (⌽≡⊢)∘⍕ ⍝ is a composition of
      ⍕ ⍝ convert to string and 
      (⌽≡⊢) ⍝ palindrome test
      (⌽≡⊢)∘⍕¨6,⊂{⍵/⍨∨\⍵}⌽2⊥⍣¯1⊢6 ⍝ apply it to each of the original argument and the bit representation
  1 1
      ∧/(⌽≡⊢)∘⍕¨6,⊂{⍵/⍨∨\⍵}⌽2⊥⍣¯1⊢6  ⍝ ∧/ tests for all 1's (truth)
  1
```
[Try it on TryAPL.org](http://tryapl.org/?a=%u2227/%28%u233D%u2261%u22A2%29%u2218%u2355%A8%7B%u2375%2C%u2282%7B%u2375/%u2368%u2228%5C%u2375%7D%u233D2%u22A5%u2363%AF1%u22A2%u2375%7D6&run)
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 7 bytes
```
↔?ḃc↔.↔
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//1HbFPuHO5qTgbQeEP//b2Rpbmpoam5p9B8A "Brachylog – Try It Online")
That's a lot of `↔`'s…
### Explanation
With the implicit input and output, the code is: `?↔?ḃc↔.↔.`
```
?↔?        The Input is a palindrome
   ḃ       Convert it to the list of its digits in binary
    c      Concatenate it into an integer
     ↔     Reverse it: this causes to remove the trailing 0's
      .↔.  The resulting number is also a palindrome
```
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 26 bytes
```
{≡∘⌽⍨⍕⍵,⍵,⍨(<\⊂⊢)⌽2⊥⍣¯1⊢⍵}
```
## Explanation
```
                  2⊥⍣¯1⊢⍵  encode ⍵ as binary
                 ⌽         reverse
           (<\⊂⊢)          partition from first 1
      ⍵,⍵,⍨                prepend and append ⍵
    ⍕                     turn into text string
≡∘⌽⍨                       match text with its reverse (f⍨X is XfX, where f is a composed function that reverses its right argument and matches with left)
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHnwkcdMx717H3Uu@JR79RHvVt1IHiFhk3Mo66mR12LNIGyRo@6lj7qXXxovSFQAKiglgKth1YYKpgpWCoYGigYGikYGisYmigYGyuYmADZJkaG5uZGFgYKRpbmpoam5pZGAA "APL (Dyalog Classic) – Try It Online")
[Answer]
# Perl, 53 +3 (-pal) bytes
```
$_=sprintf"%b",$_;s/0+$//;$_="$_/@F"eq reverse"@F/$_"
```
[try it online](https://tio.run/##K0gtyjH9/18l3ra4oCgzryRNSTVJSUcl3rpY30BbRV/fGiijpBKv7@CmlFqoUJRallpUnKrk4KavEq/0/78hl7Exl6GBIZf5v/yCksz8vOL/ugWJOQA)
[Answer]
# [Octave](https://www.gnu.org/software/octave/), ~~68~~ 66 bytes
```
@(x)all([d=num2str(x) b=deblank(['' dec2bin(x)-48])]==flip([b d]))
```
[Try it online!](https://tio.run/##JcpBDsIgFATQvadgV/5CIr9UyoLEexAWUCBpRDRajbfHgpuXyczcl819Yk2aMVYv9AsuZ2qCLu8bvrbnXhCvQ/TZlSs1w0BCXNCvZR@OYrZgtU55fVDjSbAANVEOh0TPDdXgpy52x65ojj0L8e8Fcilx7l9UcuKTVAj1Bw "Octave – Try It Online")
Initial offering from Octave.
We basically create an array containing the number as a decimal string and the number as a binary string with trailing 0's removed. Then we create an array with the same to strings but with the binary and decimal numbers flipped. Finally both arrays are compared and the result is either true if they match (both palindromes) or false if they don't (one or both not palindromes).
---
* Save 2 bytes using `flip` instead of `fliplr`.
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 10 [bytes](https://github.com/mudkip201/pyt/wiki/Codepage)
Returns [1] if true, [0] if false
```
ĐɓƖ₫áĐ₫=ʁ∧
```
[Try it online!](https://tio.run/##K6gs@f//yISTk49Ne9S0@vDCIxOAlO2pxkcdy///N7I0NzU0Nbc0AgA)
Explanation:
```
              Implicit input
Đ             Duplicate input
ɓ             Get input in binary (as string)
Ɩ             Cast to integer
₫             Reverse the digits (this removes any trailing zeroes)
á             Push the stack into a list
Đ             Duplicate the list
₫             Reverse the digits of each element of the list
=             Are the two lists equal element-wise
ʁ∧            Reduce the list by bitwise AND
```
[Answer]
# [Retina](https://github.com/m-ender/retina), 72 bytes
```
.+
$*_;$&
+`(_+)\1
$+0
0_
_
0+;
;
+`\b(\w)((\w*)\1)?\b
$3
(\B;\B)|.*
$.1
```
[Try it online!](https://tio.run/##DckxCgIxEEDR/p9jkCQDIWOCICmEPcdAdMHCxkIEG@@eTfOL9z/P7@v9mDMrkkaXE3oPQ6MbooUyGBTt9OW@B//FsJLWjzffkUrwrfsW/zkh2eY0Llyxgp2xijVqpbUD "Retina – Try It Online") Link includes test cases. Works by creating a unary duplicate of the original number, but using `_`s so that it's not confused by e.g. an input of `11`. The unary number is then converted to "binary" and trailing zeros stripped. Palindromes then get successively truncated and the last stage tests whether there is anything left.
[Answer]
# Mathematica, 70 bytes
```
(P=PalindromeQ)[PadRight[#~IntegerDigits~2,#~IntegerExponent~2]]&&P@#&
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 14 bytes
```
¤&S=↔ȯ↓=0↔ḋ⁰d⁰
```
[Try it online!](https://tio.run/##yygtzv7//9AStWDbR21TTqx/1DbZ1gDIerij@1HjhhQg/v//v7ExAA "Husk – Try It Online")
### Ungolfed/Explanation
```
             d⁰  -- digits of input in decimal
          ḋ⁰)    -- digits of input in binary
         ↔       --   reverse
     (↓=0        --   and drop all leading zeros
¤&               -- test the two lists if
  S=↔            --   they're equal to their own reverse
```
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 10 bytes
```
ṙṭ@ḍ2⁻Πbṭ∧
```
[Try it online!](https://tio.run/##S0/MTPz//@HOmQ93rnV4uKPX6FHj7nMLkoC8Rx3L//83NgYA "Gaia – Try It Online")
### Explanation
Instead of checking with leading zeroes in binary, I check without without the trailing zeros.
```
ṙ           String representation of number
 ṭ          Is palindromic?
  @         Push input again
   ḍ        Prime factors
    2⁻      Remove all 2s
      Π     Product
       b    Convert to binary
        ṭ   Is palindromic?
         ∧  Logical and
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 105 bytes
```
r(n,b){int s=0,c=n;for(;n;n/=b)s=s*b+n%b;return s==c;}
c;f(n){for(c=n;c%2<1;c/=2);return r(n,10)&r(c,2);}
```
[Try it online!](https://tio.run/##dY5BDoIwEEXXcgqDwbSKQguIpNSTuIEBlEQHU2BFODu2Jq6su5@XN/8PHG4Ay6ZFeIxVvc77oWq74/2yKIJ@SacWh3UvQx8kiqZTRKDAQJa0l/2u3KNXClUPo0ItSRCzA6IhSCejmhPweM4EBJLTr2iKWUi3WvA1nRcz8SxaJCYUdHJWL6VjQ1yvuqLrN4RRKn7pyUozK9WDVsztOLLj2Iojux3Hf7pjztKUn@0f8SxNWJJmn8fm5Q0 "C (gcc) – Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~130 129 179~~ 173 + 23 bytes
a few things, thank you to Ed Marty for pointing out that i need to check for as many 0's padded in front for a palindrome. And i need to make sure that i can check up to x^32-1.
```
x=>{var a=Convert.ToString(x,2);var b=x+"";Func<string,bool>p=z=>z.SequenceEqual(z.Reverse());return new int[a.Length].Select((_,z)=>p(new string('0',z)+a)).Any(z=>z)&p(b);}
```
[Try it online!](https://tio.run/##dVBRa8IwEH7vrzjKmMnqijqZg9qOMbYn9zIHexAZMZ5doCY1SZ229Ld3rZVBkX33kOO@@767HDe3XGmsJNuiSRlHmB@Nxa0/E3JXODxhxkBaOMYyKzi8ZpJPEyXj/kqpJNqE1SGMij3TwMJnJfeorf@h5lYLGZNDf0SDhluFB891g5PYnLhWnoZ5GOX@HHcZSo4vu4wlJPffsfYxSCgNNNpMS5D4A0LaBfNnKGP7vaw1CXJLyFc/p2GUkqajtSa9Qa8ueoxS/0keSTOCXqdkRYOyChw4/2SvxBremJCklS2WwHRsqANnFH9Zg43SpN4ABIQwDOpnCsNBk3ge7TR2ZQ3quxiVoP@phcX6rEiuXGGgECUwSFki5Fqr7SMUGyJo6dLgwqFTKJ3/DEfD8WT8cHc/nsxuRpfmHbodVDZR/QI "C# (.NET Core) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 56 bytes
```
lambda n:all(s==s[::-1]for s in(`n`,bin(n).strip("0b")))
```
[Try it online!](https://tio.run/##Pc1BCoMwEAXQvacYXCWQiona1EC2nqA7KxhpRSGNkkwXnt7GCh0YZhaP/9cNp8WJvdGP3Zr38DTglLGWBK1Dq9SFd@PiIcDsSO96NsTraBbQzytJ8yGllO53/8FpAw0tZ3BlUDMoCgailhWvZC26pDE2vE6RM@AibgS8ZFCWx18KLqW45V1ytGFsgzNUgQnh5RGOaQjSHxgPcGb@gVswgpEmq58dQrotWbp/AQ "Python 2 – Try It Online")
Uses Python's `strip` method to both remove the `bin(..)`'s output's leading `0b` *and* the binary number's trailing zeros (as they will always have a matching bit).
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~25~~ ~~22~~ ~~19~~ ~~18~~ 17 bytes
-~~3~~ ~~6~~ ~~7~~ 8 bytes by learning the language further
```
Ks_.Bsz&_IzqKs_`K
```
Explanation:
```
Ks        Set K to the integer version of...
 _.BsJ    Reverse string of the binary input
&         And
 _Iz      Is the input equal to the reverse of itself?
 qKs_`K   Is K equal to int(the reverse of basically string(K))
```
I am sure that this can be golfed down, I'll be working on that.
[Test Suite](http://pyth.herokuapp.com/?code=Ks_.Bsz%26_IzqKs_%60K&test_suite=1&test_suite_input=1%0A6%0A9%0A10%0A12%0A13%0A14%0A33%0A44&debug=0 "Pyth – Try It Online")
[Answer]
# PHP, 69+1 bytes
```
$q=trim(decbin($p=$argn),0);if(strrev($p)==$p&&strrev($q)==$q)echo$p;
```
Run as pipe with `-nR`  
Echoes the original input for truthy / nothing for falsey 
[Try it online!](https://tio.run/##NYzLCsIwEEX3fsUsQklAqS2U0kf0H9yKi5qMNtAkk1i78t9jK7g5cA6XSyOl/kwj7dgQn05uXK7FrYM8B7TvaZgRlLd2cBom47CFD6xzOLgL9MprPCUW5ByN5RrV3TjO6PfixP4oOvPgrzlGXNYspGSUZX8PmweBavSMupRS2dRVUdVN@QU)
[Answer]
# APL2 (not Dyalog), 36 bytes
```
(N≡⌽N←⍕N)^∨/(((⌽B)⍳1)↓B)⍷B←(32⍴2)⊤N←
```
First let B be the 32-bit representation of N:
```
B←(32⍴2)⊤N
```
Then mirror B and find the position of the 1st 1:
```
(⌽B)⍳1
```
Then drop that many positions from B. This will preserve the correct number of leading 0s.
Then perform FIND and an OR-REDUCTION to see if the cropped B contains its own mirror.
Now let's look at N, the decimal. The left-most bracketed expression converts N to a character vector and checks if it MATCHes its own mirror.
Finally, an AND joins the two checks.
---
In APL2 I can't make a neat lambda so I wrote a one-liner and included the assignment arrow. Hope this isn't cheating.
[Answer]
# Java 8, ~~105~~ 104 bytes
```
n->{String t=n+n.toString(n,2).replaceAll("0*$","")+n;return t.contains(new StringBuffer(t).reverse());}
```
**Explanation:**
[Try it here.](https://tio.run/##hU@xbsIwFNz5iqeog10gkBCa0ohK7VCpQ1noVnUwwdBQ8xzZL6kQyrenhmRtLdnD6e7e3R1ELca6lHjYfre5EtbCmyjwPAAokKTZiVzC6gIBNlorKRBy9uqovTSAPHNM4757lgQVOawAYQktjh/PazIF7oGWOMSQdAcZjmIeGlkqd/pJKRZMb2@CURDwIWZGUmUQKMw1kuthGcof6IzP1W4nDaOLuZbGSsZ51rRZl15WG@XS@xK1LrZwdAdY5/34BMG7FZMJvJuKvk4PV7g@WZLHUFcUlk5JChmGOYv4ddqf/J2HX3j42cwjiBfpPJqni/gfXc@4RS9CWelZNPUkRrFP4OscJR5BkngjkjhK0/i@L9sMmvYX)
```
n->{                         // Method with Integer parameter and boolean return-type
  String t=n                 //  Create a String `t` starting with the input Integer
    +n.toString(n,2)         //  Append the binary representation of the input Integer,
      .replaceAll("0*$","")  //   with all trailing zeroes removed
    +n;                      //  Append the input Integer again
  return t.contains(new StringBuffer(t).reverse());
                             //  Return true if `t` is a palindrome
}                            // End of method
```
]