本文整理匯總了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