Skip to content

Commit

Permalink
Update test_primes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
teschlg committed Nov 3, 2024
1 parent 4b0f10d commit 84a04c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_primes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_sieve_eratosthenes():
if i < len(OEIS_A000010) - 1:
assert next_prime(p+1) == OEIS_A000010[i+1]

#https://oeis.org/A000040
#https://oeis.org/A000720
OEIS_A000720 = [ 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19,
Expand All @@ -64,6 +64,7 @@ def test_is_prime():
for n in range(max_sieve // 10):
assert is_prime(n) == prime_test[n]

#https://oeis.org/A005385
OEIS_A005385 = [ 5, 7, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467,
479, 503, 563, 587, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439,
1487, 1523, 1619, 1823, 1907, 2027, 2039, 2063, 2099, 2207, 2447, 2459, 2579, 2819,
Expand All @@ -75,6 +76,7 @@ def test_is_safeprime():
for n in OEIS_A005385:
assert is_safeprime(n) == True

#https://oeis.org/A014233
OEIS_A014233 = [ 2047, 1373653, 25326001, 3215031751, 2152302898747, 3474749660383,
341550071728321, 341550071728321, 3825123056546413051, 3825123056546413051,
3825123056546413051, 318665857834031151167461, 3317044064679887385961981 ]
Expand All @@ -95,6 +97,7 @@ def test_miller_rabin():
r = randint(2, n)
assert miller_rabin_test(m, bases) == prime_test[m]

#https://oeis.org/A217255
OEIS_A217255 = [ 5459, 5777, 10877, 16109, 18971, 22499, 24569, 25199, 40309, 58519,
75077, 97439, 100127, 113573, 115639, 130139, 155819, 158399, 161027, 162133, 176399,
176471, 189419, 192509, 197801, 224369, 230691, 231703, 243629, 253259, 268349,
Expand Down

0 comments on commit 84a04c6

Please sign in to comment.