本文整理汇总了Python中Euler.miller_rabin方法的典型用法代码示例。如果您正苦于以下问题:Python Euler.miller_rabin方法的具体用法?Python Euler.miller_rabin怎么用?Python Euler.miller_rabin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Euler
的用法示例。
在下文中一共展示了Euler.miller_rabin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: factors
# 需要导入模块: import Euler [as 别名]
# 或者: from Euler import miller_rabin [as 别名]
current_max_num_factors = 0
list_of_highly_composite_numbers = []
list_of_highly_composite_num_factors = []
while 1:
# if i>1000:
# break
i += 1
# print i, Euler.miller_rabin(i)
# make sure not a prime first since we know primes only have 2 factors ( 1 and i ). will short circuit on primes
if ( not Euler.miller_rabin(i) ): # if it is a composite number
nf = dlibrary.find_number_of_factors_fast(i)
if ( nf > current_max_num_factors ):
current_max_num_factors = nf
print "%60d %30d" % (i, nf)
# list_of_highly_composite_numbers.append( i )
# list_of_highly_composite_num_factors.append( nf )
# for n in range(0,len(list_of_highly_composite_numbers)):
# print "%10d %10d" % (list_of_highly_composite_numbers, list_of_highly_composite_num_factors)