Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 用对数筛选B-光滑数的索引超出范围错误_Python_Arrays_Python 3.x_Primes_Sieve - Fatal编程技术网

Python 用对数筛选B-光滑数的索引超出范围错误

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

因此,我一直在尝试实现二次筛,并完成了步骤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 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.