本文整理汇总了Python中Euler.primesList方法的典型用法代码示例。如果您正苦于以下问题:Python Euler.primesList方法的具体用法?Python Euler.primesList怎么用?Python Euler.primesList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Euler
的用法示例。
在下文中一共展示了Euler.primesList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: euler243
# 需要导入模块: import Euler [as 别名]
# 或者: from Euler import primesList [as 别名]
def euler243():
target = 15499/94744
currentD = 1
nextFactor = 2
currFactorIndex = 0
currR = 1
while(currR>=target):
print('Current index '+str(currFactorIndex))
print('Current D '+str(currentD))
currFactorIndex+=1
if(len(Euler.currPrimes)<=currFactorIndex):
Euler.currPrimes = Euler.primesList(nextFactor*2,Euler.currPrimes)
nextFactor = Euler.currPrimes[currFactorIndex]
currentD*=nextFactor
currR = naiveResilience(currentD)
print('D'+str(currentD))
print('R'+str(currR))
示例2: euler243Heuristic
# 需要导入模块: import Euler [as 别名]
# 或者: from Euler import primesList [as 别名]
def euler243Heuristic():
target = 15499/94744
currentD = 1
nextFactor = 2
currFactorIndex = 0
currR = 1
while(currR>=target or True):
currFactorIndex+=1
if(len(Euler.currPrimes)<=currFactorIndex):
Euler.currPrimes = Euler.primesList(nextFactor*2,Euler.currPrimes)
nextFactor = Euler.currPrimes[currFactorIndex]
currentD*=nextFactor
currR = pseudoResilience(currFactorIndex)
if(currR<target):
print('Pseudo hit on Index '+str(currFactorIndex))
print(currentD)
print(currR)
print('D'+str(currentD))
print('R'+str(currR))
示例3: print
# 需要导入模块: import Euler [as 别名]
# 或者: from Euler import primesList [as 别名]
print(currentD)
print(currR)
print('D'+str(currentD))
print('R'+str(currR))
def pseudoResilience(primeN):
currentR = 1
for i in range(0,primeN+1):
currentR*=((Euler.currPrimes[i])-1)/(Euler.currPrimes[i])
return currentR
CurrentWildcardLists = [[]]
PossibleChars = ['1','2','3','4','5','6','7','8','9','0','*']
Euler.primesList(100000,Euler.currPrimes)
print('sdf')
def starifiedList(stars,num):
if(stars==1):
starOne = []
for i in range(0,len(str(num))):
starOne.append(str(num)[0:i]+"*"+str(num)[i+1:])
return starOne
lastStarified = starifiedList(stars-1,num)
for currLast = #todo loop through and whatever