Skip to main content
2 of 2
Commonmark migration

Haskell, 41 bytes

f n=1+4*sum[floor$sqrt$n*n-x*x|x<-[0..n]] 

Counts points in the quadrant x>=0, y>0, multiplies by 4, adds 1 for the center point.

xnor
  • 149.7k
  • 26
  • 287
  • 676