Skip to main content
Saved 5 bytes thanks to Leaky Nun
Source Link
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284

PowerShell, 4141 36 bytes

param($n)[math]::floor$n+(($n$x=$n-band-$n)-$x%3)/3)+$n

Try it online!Try it online! or Verify all test casesVerify all test cases

Port of Leaky Nun's Python answer.

Saved 5 bytes thanks to Leaky Nun

PowerShell, 41 bytes

param($n)[math]::floor(($n-band-$n)/3)+$n

Try it online! or Verify all test cases

Port of Leaky Nun's Python answer.

PowerShell, 41 36 bytes

param($n)$n+(($x=$n-band-$n)-$x%3)/3

Try it online! or Verify all test cases

Port of Leaky Nun's Python answer.

Saved 5 bytes thanks to Leaky Nun

Source Link
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284

PowerShell, 41 bytes

param($n)[math]::floor(($n-band-$n)/3)+$n

Try it online! or Verify all test cases

Port of Leaky Nun's Python answer.