小编pon*_*kin的帖子

Haskell中的快速Pollard Rho分解

我正在尝试在Haskell中实现Pollard Rho分解方法.这是我来的

func :: Int -> Int -> Int
func x n = mod ( x * x - 1) n

pollardStep :: Int -> Int -> Int -> Int -> Int -> Int
pollardStep i k n x y
      | d /= 1 && d /= n = d
      | i == k = pollardStep (i+1) (2*k) n x1 x1
      | otherwise = pollardStep (i+1) k n x1 y
      where d = gcd n $ abs $ …
Run Code Online (Sandbox Code Playgroud)

algorithm math haskell prime-factoring

5
推荐指数
1
解决办法
359
查看次数

标签 统计

algorithm ×1

haskell ×1

math ×1

prime-factoring ×1