Skip to main content
Commonmark migration
Source Link

#Octave, 38 37 35 bytes

Octave, 38 37 35 bytes

@(n)[(x=1:n)+x'-1 z=~x'+2*n;z' 2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

#Octave, 38 37 35 bytes

@(n)[(x=1:n)+x'-1 z=~x'+2*n;z' 2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

Octave, 38 37 35 bytes

@(n)[(x=1:n)+x'-1 z=~x'+2*n;z' 2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

added 7 characters in body
Source Link
rahnema1
  • 5.7k
  • 1
  • 15
  • 22

#Octave, 38 3737 35 bytes

@(n)[(x=1:n)+x'-1 ~x'+2*n;~[xz=~x'+2*n;z' 1]+2*n]2*n]

Try it online!Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

#Octave, 38 37 bytes

@(n)[(x=1:n)+x'-1 ~x'+2*n;~[x 1]+2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

#Octave, 38 37 35 bytes

@(n)[(x=1:n)+x'-1 z=~x'+2*n;z' 2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

added 8 characters in body
Source Link
rahnema1
  • 5.7k
  • 1
  • 15
  • 22

#Octave, 3838 37 bytes

@(n)[(x=1:n)+x'-1 ~x'+2*n; ~[x~x'+2*n;~[x 1]+2*n]

Try it online!Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

#Octave, 38 bytes

@(n)[(x=1:n)+x'-1 ~x'+2*n; ~[x 1]+2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

#Octave, 38 37 bytes

@(n)[(x=1:n)+x'-1 ~x'+2*n;~[x 1]+2*n]

Try it online!

or

@(n)~(k=blkdiag((x=1:n)+x'-1,0))*2*n+k

Try it online!

added 193 characters in body
Source Link
rahnema1
  • 5.7k
  • 1
  • 15
  • 22
Loading
Source Link
rahnema1
  • 5.7k
  • 1
  • 15
  • 22
Loading