summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 2cf77af..7fd05ad 100644
--- a/main.go
+++ b/main.go
@@ -17,12 +17,13 @@ import (
)
func seed(N *big.Int) (<-chan *big.Int, <-chan *big.Int) {
- // we start with sqrt(N)
+ // begin with floor(sqrt(N))
p := mathutil.SqrtBig(N)
p.SetBit(p, 0, 1) // ensure it's odd
+ // corelated value floor(N/q)
q := new(big.Int).Div(N, p)
- q.SetBit(p, 0, 1) // ensure it's odd
+ q.SetBit(q, 0, 1) // ensure it's odd
nxt := make(chan *big.Int)
go func(c chan *big.Int, n *big.Int) {