$0=N+1 # $0,$1 := (N+1),(N/K); $1=N/K $2=N*N # $2,$3 := (N*N),(K*N); $3=K*N while$0>$1 # while $0>$1: $0=$1 # $0,$1 := $1,(($1*$1+N*N)/(2*$1+K*N)); $4=$1*$1 $1=2*$1 $4=$4+$2 $1=$1+$3 $1=$4/$1 end # end $0=$0+N # return ($0+N); return$0