Python 用对数筛选B-光滑数的索引超出范围错误
因此,我一直在尝试实现二次筛,并完成了步骤1(在代码中): 这里genPrimes()是Eratosthenes的筛,jacobi检查n是否是二次剩余mod i,modInverse是Tonelli-Shanks算法 二次筛的下一步是:Python 用对数筛选B-光滑数的索引超出范围错误,python,arrays,python-3.x,primes,sieve,Python,Arrays,Python 3.x,Primes,Sieve,因此,我一直在尝试实现二次筛,并完成了步骤1(在代码中): 这里genPrimes()是Eratosthenes的筛,jacobi检查n是否是二次剩余mod i,modInverse是Tonelli-Shanks算法 二次筛的下一步是: Initialize a sieve array to 0's. For each odd prime p in the factor base, add l[p] to the locations sol1[p] + ip and soln[p] + ip o
Initialize a sieve array to 0's. For each odd prime p in the factor
base, add l[p] to the locations sol1[p] + ip and soln[p] + ip of the sieve array, for
i = 0, 1, 2,... For the prime p = 2, sieve only with sol1.
或者如本文所述:
然后我必须从中添加值,请简化并将错误stacktrace放在问题中,它本身大小是多少?大小是60对不起。什么是错误stacktrace。@AlbinPaul更好吗?请简化并将错误stacktrace放在问题中,它本身的大小是多少?大小是60对不起。什么是错误stacktrace?AlbinPaul更好吗?
Initialize a sieve array to 0's. For each odd prime p in the factor
base, add l[p] to the locations sol1[p] + ip and soln[p] + ip of the sieve array, for
i = 0, 1, 2,... For the prime p = 2, sieve only with sol1.