当前位置: 首页>>代码示例>>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;未经允许,请勿转载。