Skip to main content
added 3 characters in body; deleted 1 character in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, 17 1414 13 bytes / 1212 7 characters

Round[#⌊#/√2]&√2⌋& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

-1 byte, -5 characters, as per @Mark S. suggestedsuggestion, by using ⌊⌋.

⌊#/√2⌋& 

to save 1For just one more byte and(but 5 more characters, but this no longer rounds) I can always round to the nearest integer, as it always rounds down. A similar program can be made to always round up. with

Round[#/√2]& 

Mathematica, 17 14 bytes / 12 characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋& 

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

Mathematica, 17 14 13 bytes / 12 7 characters

⌊#/√2⌋& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

-1 byte, -5 characters, as per @Mark S. suggestion, by using ⌊⌋.

For just one more byte (but 5 more characters) I can always round to the nearest integer with

Round[#/√2]& 
added 193 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, 17 14 bytes / 12 characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋& 

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

Mathematica, 17 14 bytes / 12 characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, 17 14 bytes / 12 characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋& 

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

deleted 4 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, 17 14 bytes (but/ 12 chars :'( )characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, 17 14 bytes (but 12 chars :'( )

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, 17 14 bytes / 12 characters

Round[#/√2]& 

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

deleted 9 characters in body; added 30 characters in body; added 105 characters in body; added 49 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117
Loading
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117
Loading