#Python, 114 110 96 90 bytes
Python, 114 110 96 90 bytes
Totally changed:
lambda n:[bin(sum(2**p for p in[range(n),{0,n-1,r,n-1-r}][0<r<n-1]))[2:]for r in range(n)]
Returns a list of strings, characters using 1
and 0
.
-6 bytes thanks to TheBikingViking
Test it at ideone
Previous Python 2 @110
def f(n):g=range(n);n-=1;print'\n'.join(''.join((c in(r,n-r,0,n)or r in(0,n))and'#'or' 'for c in g)for r in g)
Test it on ideone