ifK<=2 # if K<=2: $2=K*K # $1 := K**6+5*K**4+6*K**2+1; $2=$2+1 # $0 := K**5+4*K**3+3*K; $3=$2*K # $2 := K**4+3*K**2+1; $0=$3+K $1=$0*K $2=$1+$2 $3=$2*K $0=$3+$0 $1=$0*K $1=$1+$2 end # end ifK>=3 # if K>=3: $1=K*K # $1 := K**2+1; $1=$1+1 $0=K # $0 := K; $2=1 # $2 := 1; end # end while$1<100000 # while $1<100000: $3=$0*$0 # $1,$0,$2 := ($0*$0+$1*$1),($0*($1+$2)),($0*$0+$2*$2); $4=$1+$2 $0=$0*$4 $1=$1*$1 $2=$2*$2 $1=$1+$3 $2=$2+$3 end # end $5=N/K # $5 := N/K; while$1<=$5 # while $1<=(N/K): $2=$1 # $1,$0,$2 := (($1*K+$0)*K+$1),($1*K+$0),($1); $3=$1*K $0=$3+$0 $1=$0*K $1=$1+$2 end # end $0=$0*N # return ($0*N/$1+N); $0=$0/$1 $0=$0+N return$0