File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
project_euler/problem_810 Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 2727
2828"""
2929
30- from bitarray import bitarray
31-
3230
3331def xor_multiply (a : int , b : int ) -> int :
3432 """
@@ -92,15 +90,8 @@ def count_irreducibles(d: int) -> int:
9290 Count the number of irreducible polynomials of degree d over GF(2)
9391 using the Möbius function.
9492
95- Args:
96- d (int): Polynomial degree.
97-
98- Returns:
99- int: Count of irreducible polynomials.
100-
101- Example:
102- >>> count_irreducibles(3)
103- 2
93+ >>> count_irreducibles(3)
94+ 2
10495 """
10596 mob = mobius_table (d )
10697 total = 0
@@ -126,9 +117,8 @@ def find_xor_prime(rank: int) -> int:
126117
127118 limit = 1 << (degree + 1 )
128119
129- sieve = bitarray (limit )
130- sieve .setall (True )
131- sieve [0 :2 ] = False
120+ sieve = [True ] * limit
121+ sieve [0 ] = sieve [1 ] = False
132122
133123 for even in range (4 , limit , 2 ):
134124 sieve [even ] = False
You can’t perform that action at this time.
0 commit comments