<分区>
我正在寻找一种算法来帮助我像那样拆分数字 N
N = (p1a)(p2b)... ..*(pnz)
在哪里
N is the given number
p is prime numbers smallest to greatest
a,b,..z are the power over the prime
* is the multiplication operation
<分区>
我正在寻找一种算法来帮助我像那样拆分数字 N
N = (p1a)(p2b)... ..*(pnz)
在哪里
N is the given number
p is prime numbers smallest to greatest
a,b,..z are the power over the prime
* is the multiplication operation
最佳答案
这叫做因式分解。 google 的关键字:prime factorization algorithm
。
问题是,我们仍然无法真正快速地做到这一点。它为密码学(例如 RSA 算法)奠定了良好的基础。
祝你好运!
关于algorithm - 有什么方法可以通过乘以某个素数来拆分数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13047571/