Skip to main content
deleted 1 character in body
Source Link
Gymhgy
  • 8k
  • 11
  • 35

C# (Visual C# Interactive Compiler), 6867 bytes

n=>8*(x=((int)Math.Sqrt(--n)+1)/2+1>>1)*x+(n<4*x*x+2*x?-2:6)*x+1-n;int x;

Try it online!Try it online!

C# (Visual C# Interactive Compiler), 68 bytes

n=>8*(x=((int)Math.Sqrt(--n)+1)/2)*x+(n<4*x*x+2*x?-2:6)*x+1-n;int x;

Try it online!

C# (Visual C# Interactive Compiler), 67 bytes

n=>8*(x=(int)Math.Sqrt(--n)+1>>1)*x+(n<4*x*x+2*x?-2:6)*x+1-n;int x;

Try it online!

Source Link
Gymhgy
  • 8k
  • 11
  • 35

C# (Visual C# Interactive Compiler), 68 bytes

n=>8*(x=((int)Math.Sqrt(--n)+1)/2)*x+(n<4*x*x+2*x?-2:6)*x+1-n;int x;

Try it online!