[Question]
  [
Given a positive integer `n >= 1`, output the first `n` rows of the following structure:
```
   #
  # #
  ###
 #   #
 # # #
 ## ##
 #####
#     #
#  #  #
# # # #
# ### #
##   ##
## # ##
### ###
#######
```
The `n`-th 1-indexed row is the binary representation of `n`, mirrored without copying the last character, with `#` in place of 1 and `<space>` in place of 0. All rows are centered.
You must output as ASCII-art but you may use any non-whitespace character in place of where I use `#` in the example. Trailing whitespace is allowed, and a trailing newline is allowed. The output must look like the example, and no extra leading whitespace or leading newlines.
You can view the first 1023 rows of the fractal cathedral [here](https://gist.githubusercontent.com/hyper-neutrino/95a00814b4abb3b1bf6985affe65fb6d/raw/57b6ee5e7b0471b62aa441f4934c494f25a1c3d6/fractal-cathedral.txt).
To generate larger test cases, here's an ungolfed reference implementation in [Python](https://tio.run/##XY9NCoMwEIXXySkGukhCrTSWboSeRFykGjVFExlTxNOniUUK3b033/y9efODs7cQzDQ79DApP1Da6g5aVCtHty6ipGQ1rR/gseO80Wbkuxpdv7fAGWQGhRCUdA4hlsBYQGV7zSM4WtIm8jRW4RZ3RZGGRVWU9V89ihz1PKpGc3ZlGTBgIsfXe/F8f0X8sEz4xOJpMqOxnn/nq/Ii63j0cMmKmCylkncRwgc) 
  
[Answer]
# [MATL](https://github.com/lmendo/MATL), 10 bytes
```
:B2&Zv35*c
```
[Try it online!](https://tio.run/##y00syfn/38rJSC2qzNhUK/n/f0NTAA "MATL – Try It Online")
### Explanation
```
:      % Implicitly input n. Push range [1 2 ... n]
B      % Convert to binary. Gives a matrix where each row corresponds to
       % a number. Rows have left-padding zeros if needed
2      % Push 2
&Zv    % Symmetrize along sepecified dimension (2nd means horizontally),
       % without repeating the last element
35*    % Multiply by 35 (ASCII code for '#')
c      % Convert to char. Char 0 is shown as space. Implicitly display
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 9 bytes
### Code:
```
Lb€û.c0ð:
```
Uses the **05AB1E** encoding. [Try it online!](https://tio.run/##MzBNTDJM/f/fJ@lR05rDu/WSDQ5vsPr/39AUAA "05AB1E – Try It Online")
### Explanation:
```
L              # List [1, .., input]
 b             # Convert each to binary
  €û           # Palindromize each binary number
    .c         # Join the array by newlines and centralize
      0ð:      # Replace zeroes by spaces
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
RBUz0ZUŒBo⁶Y
```
[Try it online!](https://tio.run/##y0rNyan8/z/IKbTKICr06CSn/EeN2yL///9vaAoA "Jelly – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 92 bytes
```
n=input()
for x in range(n):s=bin(2**len(bin(n))/4+x+1)[3:].replace(*'0 ');print s+s[-2::-1]
```
[Try it online!](https://tio.run/##FcZBCoMwEAXQfU8xO2cSbDXtxognERdW0jYg35BE0NOn@FYvnPm3wZSCwSPsmeX22SId5EFxxtcxxKbh7cFGqdWBr0Lk8dKHbmV82ukeXVjnxbGqGqqkD9EjU9JprI21dTuV0v0B "Python 2 – Try It Online")
In Python 3, `s=f'{x+1:0{len(bin(n))-2}b}'.replace(*'0 ')` is shorter, but `int(input())` and parens around the `print` argument push it up to 95 bytes.
[Answer]
# JavaScript (ES6), 106 bytes
Uses `1` as the non-whitespace character.
```
f=(n,k=0)=>k++<n?[...Array(32-Math.clz32(n))].reduce((s,_,i)=>(c=k>>i&1||' ')+s+(i?c:''),'')+`
`+f(n,k):''
```
### Demo
```
f=(n,k=0)=>k++<n?[...Array(32-Math.clz32(n))].reduce((s,_,i)=>(c=k>>i&1||' ')+s+(i?c:''),'')+`
`+f(n,k):''
O.innerText = f(15)
```
```
<pre id=O>
```
### Alternate version (same size)
Without `Math.clz32()`:
```
f=(n,a=[k=i=0])=>n>>i+1?f(n,a,a[++i]=i):k++<n?a.reduce((s,i)=>(c=k>>i&1||' ')+s+(i?c:''),'')+`
`+f(n,a):''
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~21~~ ~~20~~ 18 bytes
Thanks @Zgarb for golfing off 2 bytes!
```
S↑(tfS=↔ΠR" #"←DLḋ
```
[Try it online!](https://tio.run/##ASYA2f9odXNr//9T4oaRKHRmUz3ihpTOoFIiICMi4oaQREzhuIv///8xNQ "Husk – Try It Online")
### Ungolfed/Explanation
To avoid lengthy padding, this determines the width of the fractal which is given as `2*len(bin(N))-1` and generates all sequences of that length with the symbols `#,_` ('\_' denotes a space).
Since the Cartesian power is generated in order and the binary numbers are too, this is fine. All we need to do to get the fractal at this point, is filtering out all palindromes and that's basically it:
```
                    -- implicit input N
S↑(                 -- take N from the following list
        ΠR" #"      --   Cartesian power of [" #"] to
                Lḋ  --     number of bits in bin(N)
               D    --     2*
              ←     --     -1
    fS=↔            --   filter out palindromes
   t                --   drop the first line (all spaces)
```
[Answer]
# Mathematica, 94 bytes
```
Column[Row/@Table[s=IntegerDigits[i,2];Join[s,Reverse@Most@s]/.{0->" ",1->"#"},{i,#}],Center]&
```
[Answer]
# Mathematica, 98 bytes
```
Riffle[Nest[ArrayFlatten@{{0,#,0},{1,0,1},{1,#,1}}&,{1},⌊Log2@#⌋]~Take~#"#"/. 0->" ","
"]<>""&
```
Try it at the [Wolfram sandbox](https://sandbox.open.wolframcloud.com/)! The `⌊` and `⌋` are three bytes each.
It's a different approach from the other answers so far, using the fractal nature of the pattern. The key step is `ArrayFlatten@{{0,#,0},{1,0,1},{1,#,1}}&`, which does the fractally stuff, best explained in picture form:
```
                 [    ]
                 [grid]
[    ]           [    ]
[grid]   --->   #      #
[    ]          #[    ]#
                #[grid]#
                #[    ]#
```
The code repeats this step enough times to get at least *n* rows, then trims off the extra rows and displays it nicely.
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 11 bytes
```
 #”B¦ₔṫ¦€|ṣ
```
[Try it online!](https://tio.run/##S0/MTPz/X0H5UcNcp0PLHjVNebhzNYheU/Nw5@L//00NAA "Gaia – Try It Online")
### Explanation
```
    ¦ₔ       For each number 1..input:
 #”B          Convert it to base 2 and use space as 0 and # as 1
      ṫ¦     Palindromize each
        €|   Centre the lines
          ṣ  Join with newlines
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~120~~ ~~118~~ 107 bytes
thanks @luismendo, @officialaimm, @halvard-hummel
```
def f(l):
 for a in range(1,l+1):print(bin(a)[2:]+bin(a)[-2:1:-1]).replace(*'0 ').center(len(bin(l+1))*2-4)
```
[Try it online!](https://tio.run/##LcwxDoMwDEDRvafwhg0NIlYnX6ViSKnTRopMFGXh9KmK2P7yfjnadzfu/a0RImaSG8S9QoBkUIN9FP09T56k1GQNX8kw0JNlna50LF6cX2muWnLYFMdhgYHmTa1pxax2qv@ERnYP6hH9wtR/ "Python 2 – Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~192~~ ~~178 bytes~~ 168+23
thank you TheLethalCoder for the help.
```
x=>new int[x].Select((_,z)=>Convert.ToString(z+1,2).PadLeft((int)Math.Log(x,2)+2).Replace('0',' ')).Aggregate((y,z)=>y+"\n"+z+new string(z.Reverse().Skip(1).ToArray()))
```
[Try it online!](https://tio.run/##TVDfS8MwEH62f0XYS@9oDdvwrXYwBJ82ECv4MIeE7BaDbVKTbK4b/dtr3BR9vO@@X3fSX0vraNh5bRSrOh@o4QttPor/SJEY0ZBvhSTWOqucaE6JrIX3f6MPImjJ7ndG3moTch9cNJhty@FQzgx9sgiuDmteUU0yALzmRyxnd9bsyQX@ZKszH47ZJJ8ifxCbBW0jLapwKcIbX1gFh7jK4vaR2jp2gXSc5ilLEflcKUdKBALozsZdNnoxo@yYfUf7H@8ojGmeAHn1rluYYAyeOyc6QMSh@D1ib/WGLYU2cFGu1kw45fGUXMXC3tbEn50OFB9FsIXJeHqDWCR90vfDFw "C# (.NET Core) – Try It Online")
pretty sure this can be reduced by a lot, most likely in the padding and reversing of the string.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 28 bytes
```
Ａ…·¹ＮθＷ⌈θ«Ｅθ§ #κ↓⸿ＡＥθ÷κ²θ»‖Ｏ
```
[Try it online!](https://tio.run/##NY27CoMwFEDn@hUXuyQQBwtd6lRwcegD5y423mowRs1LofTbUwt2PZzD4W2l@VDJEM7GiEaRQnHpjPBYVqpBkjIo1Ojs1fVP1IRSBhPNorkVEoFcqkX0ricTpfCOdnctlF3hSCYGZ1uoGhcSwz5m0FG6ZptxyodZMYgfOv7B7bx1hbK58KJG0jE4/IefqMSXRG5vHrVcTZqFkB5D4kNi5Bc "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ａ…·¹Ｎθ
```
Create a list of the first `n` natural numbers.
```
Ｗ⌈θ«
```
Repeat until all elements are zero.
```
Ｅθ§ #κ
```
Print the last binary digit of each element of the list as a  or `#`.
```
↓⸿
```
Move to the previous column.
```
ＡＥθ÷κ²θ
```
Divide all elements of the list by two.
```
»‖Ｏ
```
Once the left half has been drawn, reflect it.
[Answer]
# J, 29 bytes
```
' #'{~(],}.@|.)"1@(#.^:_1)@i.
```
[Try it online!](https://tio.run/##y/r/P81WT0FdQVm9uk4jVqdWz6FGT1PJ0EFDWS/OKt5Q0yFTj4srNTkjXyFNwcjg/38A "J – Try It Online")
## explanation
* `i.` integers up to n, the input
* `(#.^:_1)` converted to base 2
* `(],}.@|.)` row by row (`"1` does that part), take the binary number (`]` is the identity fn), and cat it (`,`) with its reverse (`|.`), where the reverse is beheaded (`}.`).
* `' #'{~` converts the `1`s and `0`s to hashes and spaces.
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 95 bytes
```
r=>{for i:range(1,r)print(((bin(i)[2to]).rjust(len(bin(r))-2)[to-1,to by-1]).replace('0',' '))}
```
[Try it online!](https://tio.run/##HcpBCsIwEAXQq2SX@ZCI6cKFUC9SXLSSSKTMhHG6EPHskXb7eE3FhHsZu463bxF19aozPzOloGha2YhoqUwV02Byx0lf29tozXywAnHAZBJTMHHLJ6b95LbOj0z@7IN3Hvj1QumC/gc "Proton – Try It Online")
There are too many bugs to not have too many brackets... I need to fix up the parser...
[Answer]
# [Python 2](https://docs.python.org/2/), 89 bytes
```
n=input()+1
w=' #'
while len(w)<n:w=[s+l+s for s in' #'for l in w]
print'\n'.join(w[1:n])
```
[Try it online!](https://tio.run/##FctBCoAgEEbhvacYaGEiBAVtIk9SLosm5FfSGDq91e5bvJeeckQMtcIx0l1aY3slTlOjlRwcNgobWjEzJnFLtsFm2uNFmRh/9Dt8JvEqXYyiV@jujPxNSz/Bm1rHFw "Python 2 – Try It Online")
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), 11 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
∫2─0@ŗ}¹╬⁴╚
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JXUyMjJCMiV1MjUwMDBAJXUwMTU3JTdEJUI5JXUyNTZDJXUyMDc0JXUyNTVB,inputs=MTY_)
[Answer]
# PHP, ~~98 97 95~~ 94+1 bytes
```
while($r++<$argn)echo$s=strtr(sprintf("%".-~log($argn,2).b,$r),0," "),substr(strrev("
$s"),1);
```
Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/68d0b8006aac9915276447b94e6a63c890f07ac0). Uses `1` as non-whitespace.
[Answer]
# [K (ngn/k)](https://github.com/ngn/k), 19 bytes
```
{" #"@+a,1_|a:!x#2}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqlpJQVnJQTtRxzC@JtFKsULZqPa/oYNSTJ6SfpqCifV/AA "K (ngn/k) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 93 bytes
```
n=input()
for i in range(n):s=bin(2**n.bit_length()+i+1)[3:].replace(*'0 ');print s+s[-2::-1]
```
[Try it online!](https://tio.run/##BcFBCoMwEAXQfU8xOycJSpPSTcSTiBQtqQ7INyTTRU@fvpd/elwIrWES5K@yuX2uQkICKiv2xDCxTpuAg7UYNtHXmbDrwcaJ82Z@xGUoKZ/rO7Ht7tSZMReBUnV17kOMvV9a888/ "Python 2 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 146 108 105 bytes
```
#define o putchar(33-!(c&(1<<n)))
b;c;p(n){--n?o,p(n),o:o;}f(n){while(n>>++b);while(c++<n)p(b),puts("");}
```
[Try it online!](https://tio.run/##JY3NCsIwEITveYpYQXab5FB6M6U@iHhI1/4EdFNq1UPps8cE5zTzwcyQGYliPN77wXMvg5zfK01ugbo2B6ATVE3DiCg6S3YGxs0YvgSdrQ7nYPchw@/kHz1w2yrVof0nUipVZ@hQp9EXFAXaPXpe5dN5hmzcMpKW@U@WZQofFJuQSQO4NXjI6FrdEK3YY6yrHw "C (gcc) – Try It Online")
This is a function `f(n)` called with the number of rows `n`, using an exclamation mark (`!`) as non-whitespace character.
**Explanation**:
```
#define o putchar(33-!(c&(1<<n)))
b;c;
p(n)
{
    // least significant bit not yet reached?
    --n?
            // print bit twice with recursive step between
            o,
            p(n),
            o
        // for least significant, just print this bit
        :o;
}
// the main "cathedral function":
f(r)
{
    // determine max number of bits to shift
    while(r>>++b);
    // iterate over rows
    while(c++<r)
        // print row recursively
        p(b),
        // newline
        puts("");
}
/**
 * footer, just calling the function
 */
main(int argc, char **argv)
{
    f(atoi(argv[1]));
}
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~156~~ 149 bytes
**-7 bytes by @ConorO'Brien**
```
f=(n,w=n.toString(2).length,b=n.toString(2).replace(/0/g," "),s=" ".repeat(w-b.length))=>`${--n?f(n,w)+s+b+[...b].reverse().join``.substr(1):s+"1"}
`
```
[Try it online!](https://tio.run/##XYy9CsIwFEZ3n0KKQy75aRVchOhDOIqQpN7GlpCUJLaD@OyxBSenA4fzfYOedGpjP2buwwNL6STxbJZe5HDNsfeWHEA49DY/mfnTEUenWyR1U1tWbStgSS5YPepMZm5@SwB5Vrs35/7SrfdAEzX0JoQw96WeMCYkIIbQe6VEepmUI9nDKdFqX302qrTBp@BQuGBJR44NQPkC "JavaScript (Node.js) – Try It Online")
Recursive function. Unfortunately JS does not support reversing a string, so 19 bytes are used on turning it into an array and back.
[Answer]
# [Perl 5](https://www.perl.org/), 77 + 1 (-n) = 78 bytes
```
$x=1+(log$_)/log 2;map{$_=sprintf"%0${x}b",$_;y/0/ /;say$_.chop.reverse}1..$_
```
[Try it online!](https://tio.run/##DcVRCoMwDADQq4hk4Jim7UAQikfYGYJKtwmuDa2Minj1Zb6fxy4urQjk3tyqJbyAruqsuNvPwDtQnzjOfn2WFw17PsayBrKb0qpQNg0bEE7vwBjd18XkDoMIJNL9Aq9z8EmaR4vaaGn8Hw "Perl 5 – Try It Online")
Using '1' instead of '#' because it saves a couple bytes.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ç▼┼Ö☺Ç¬É
```
[Run and debug it](https://staxlang.xyz/#p=871fc5990180aa90&i=22&a=1)
Shortest answer so far. Uses CP437 charcode 1 in place of `#`.
ASCII equivalent:
```
{:B|pm|Cm
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-R`](https://codegolf.meta.stackexchange.com/a/14339/), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
õ_s*iS)êÃû
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LVI&code=9V9zKmlTKerD%2bw&input=MTU)
```
õ_s*iS)êÃû     :Implicit input of integer U
õ              :Range [1,U]
 _             :Map
  s            :  Convert to string in base
   *i          :    "*" prepended with
     S         :    Space
      )        :  End base conversion
       ê       :  Palindromise
        Ã      :End map
         û     :Centre pad each element with spaces to the length of the longest
               :Implicit output, joined with newlines
```
]