예제 #1
0
 def test_negative_1(self):
     self.assertEqual(pyprimesieve.primes_sum(-1), 0)
예제 #2
0
 def test_smallnums_4(self):
     self.assertEqual(pyprimesieve.primes_sum(3), 2)
예제 #3
0
 def test_smallnums_5(self):
     self.assertEqual(pyprimesieve.primes_sum(4), 5)
예제 #4
0
def main():
    ''' Driver function '''
    print(primes_sum(2000000))
예제 #5
0
 def test_smallnums_3(self):
     self.assertEqual(pyprimesieve.primes_sum(2), 0)
예제 #6
0
 def test_ranges_2(self):
     s = pyprimesieve.primes_sum(7, 22)
     self.assertEqual(s, 67)
     self.assertEqual(s, sum(pyprimesieve.primes(22)[3:]))
예제 #7
0
 def test_bignums_1(self):
     self.assertEqual(pyprimesieve.primes_sum(10**5),
                      sum(pyprimesieve.primes(10**5)))
예제 #8
0
 def test_ranges_1(self):
     s = pyprimesieve.primes_sum(3, 13)
     self.assertEqual(s, 26)
     self.assertEqual(s, sum(pyprimesieve.primes(13)[1:]))
예제 #9
0
 def test_ranges_2(self):
     s = pyprimesieve.primes_sum(7, 22)
     self.assertEqual(s, 67)
     self.assertEqual(s, sum(pyprimesieve.primes(22)[3:]))
예제 #10
0
 def test_negative_1(self):
     self.assertEqual(pyprimesieve.primes_sum(-1), 0)
예제 #11
0
 def test_negative_3(self):
     self.assertEqual(pyprimesieve.primes_sum(-949248, -4848), 0)
예제 #12
0
 def test_smallnums_5(self):
     self.assertEqual(pyprimesieve.primes_sum(4), 5)
예제 #13
0
 def test_smallnums_4(self):
     self.assertEqual(pyprimesieve.primes_sum(3), 2)
예제 #14
0
 def test_smallnums_3(self):
     self.assertEqual(pyprimesieve.primes_sum(2), 0)
예제 #15
0
 def test_negative_3(self):
     self.assertEqual(pyprimesieve.primes_sum(-949248, -4848), 0)
예제 #16
0
 def test_ranges_3(self):
     '''start > n... please no seg fault!!1'''
     self.assertEqual(pyprimesieve.primes_sum(55, 22), 0)
예제 #17
0
 def test_ranges_1(self):
     s = pyprimesieve.primes_sum(3, 13)
     self.assertEqual(s, 26)
     self.assertEqual(s, sum(pyprimesieve.primes(13)[1:]))
예제 #18
0
 def test_bignums_2(self):
     self.assertEqual(pyprimesieve.primes_sum(10**6), sum(pyprimesieve.primes(10**6)))
예제 #19
0
 def test_ranges_3(self):
     '''start > n... please no seg fault!!1'''
     self.assertEqual(pyprimesieve.primes_sum(55, 22), 0)
예제 #20
0
파일: 010.py 프로젝트: jaredks/euler
from pyprimesieve import primes_sum
print primes_sum(2000000)
예제 #21
0
def getSolution(limit):
    return pyprimesieve.primes_sum(limit)
예제 #22
0
파일: e010.py 프로젝트: horse-eye/euler
def ps_sum_super(limit=2000000):
    return pp.primes_sum(limit)