以编程方式分解大量 [英] programmatically factorize a large number

查看:68
本文介绍了以编程方式分解大量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我有很多f.实际上,这个数字长于100位数.我知道这些因素的大小大致相同.

Alright, so I have a huge number f. This number is just over 100 digits long, actually. I know that the factors are of approximately the same size.

如果我的资源和时间有限,应该使用哪种语言和算法?我包括了在限定时间内对算法进行编码的时间长度.

If I have limited resources and time, what language and algorithm should I use? I am including the length of time to code the algorithm in the restricted time.

有想法吗?

受限制,我的意思是在尽可能短的时间内.

By limited, I mean in the least amount of time possible.

推荐答案

最新的素数分解算法是二次筛及其变体.对于大于100位数的数字,数字筛子变得更加有效.

The state-of-the-art prime factorization algorithm is the quadratic sieve and its variants. For numbers larger than 100 digits, the number sieve becomes more efficient.

此处有一个开源实现.仅在在2.2 GHz频率下运行4小时,就可以将100位数字分解为两个大致相等的质数AMD Althon .

There's an open-source implementation of it here. It's able to factor a 100 digit number into two roughly equal primes in only 4 hours on a 2.2 GHz AMD Althon.

因此有算法和示例实现.这可能足以给您带来想法或让您入门.

So there's the algorithm and a sample implementation. That might be enough to give you ideas or get you started.

这篇关于以编程方式分解大量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆