當前位置: 首頁>>代碼示例>>Python>>正文


Python Euler.primesList方法代碼示例

本文整理匯總了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))
開發者ID:msimmara,項目名稱:NoSpeulers,代碼行數:19,代碼來源:Euler2.py

示例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))
開發者ID:msimmara,項目名稱:NoSpeulers,代碼行數:22,代碼來源:Euler2.py

示例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
    
        


開發者ID:msimmara,項目名稱:NoSpeulers,代碼行數:28,代碼來源:Euler2.py


注:本文中的Euler.primesList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。