コード例 #1
0
A090748=A000043.apply(lambda n:n-1,desc='Numbers n such that 2^(n+1) - 1 is prime.')

A006862=Sequence(
    math2.euclid_gen,
    # lambda n:math2.mul(math2.primes(n))+1, # TODO: make it faster
    desc="Euclid numbers: 1 + product of the first n primes."
)

A002110=A006862-1
A002110.desc="Primorial numbers (first definition): product of first n primes"

A057588=(A002110-1).filter(bool) #remove leading 0 ...  
A057588.desc="Kummer numbers: -1 + product of first n consecutive primes."

A005234=A000040.filter(
    lambda n:math2.is_prime(math2.mul(math2.sieve(n+1))+1), #TODO: find a simple way to reuse A006862 or euclid_gen
    desc='Primorial primes: primes p such that 1 + product of primes up to p is prime'
)

A034386=Sequence(
    0,
    lambda n:math2.mul(math2.sieve(n+1,oneisprime=True)),
    desc="Primorial numbers (second definition): n# = product of primes <= n"
)


#TODO: understand why A000720 creates a hudge bad side effect on many other serquences
"""
A000720=Sequence(
    1,
    lambda n:len(math2.sieve(n+1,oneisprime=True)),
コード例 #2
0
ファイル: oeis.py プロジェクト: pombredanne/Goulib
A090748=A000043.apply(lambda n:n-1,desc='Numbers n such that 2^(n+1) - 1 is prime.')

A006862=Sequence(
    math2.euclid_gen,
    # lambda n:math2.mul(math2.primes(n))+1, # TODO: make it faster
    desc="Euclid numbers: 1 + product of the first n primes."
)

A002110=A006862-1
A002110.desc="Primorial numbers (first definition): product of first n primes"

A057588=(A002110-1).filter(bool) #remove leading 0 ...  
A057588.desc="Kummer numbers: -1 + product of first n consecutive primes."

A005234=A000040.filter(
    lambda n:math2.is_prime(math2.mul(math2.sieve(n+1))+1), #TODO: find a simple way to reuse A006862 or euclid_gen
    desc='Primorial primes: primes p such that 1 + product of primes up to p is prime'
)

A034386=Sequence(
    0,
    lambda n:math2.mul(math2.sieve(n+1,oneisprime=True)),
    desc="Primorial numbers (second definition): n# = product of primes <= n"
)


#TODO: understand why A000720 creates a hudge bad side effect on myna other serquences
"""
A000720=Sequence(
    1,
    lambda n:len(math2.sieve(n+1,oneisprime=True)),
コード例 #3
0
ファイル: image.py プロジェクト: goulu/Goulib
 def npixels(self):
     return math2.mul(self.size)
コード例 #4
0
 def npixels(self):
     return math2.mul(self.size)