Skip to main content
Commonmark migration
Source Link

##Haskell, 41 bytes

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.

##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.

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.

Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

##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.