Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 27, 2024
1 parent 2fb447e commit ad3e77e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/p0047.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from itertools import count
from typing import Tuple

from lib.primes import is_prime
from lib.iters import groupwise
from lib.primes import is_prime


@lru_cache()
Expand Down
2 changes: 1 addition & 1 deletion python/p0050.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"""
from typing import List

from lib.primes import is_prime, primes
from lib.iters import groupwise
from lib.primes import is_prime, primes


def main() -> int:
Expand Down
3 changes: 2 additions & 1 deletion python/p0055.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
NOTE: Wording was modified slightly on 24 April 2007 to emphasise the theoretical nature of Lychrel numbers.
"""
from p0004 import is_palindrome

from lib.iters import digits
from lib.math import from_digits


def steps_to_palindrome(n: int, depth: int = 0) -> int:
"""Returns a 0 if the number does not reach a palindrome in 50 or fewer steps, otherwise returns the step count"""
new = n + from_digits(reversed([*digits(n)]))
new = n + from_digits(digits(n))
if is_palindrome(new):
return depth + 1
elif depth == 50:
Expand Down
2 changes: 1 addition & 1 deletion python/p0057.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main() -> int:
answer = 0
for x in range(1_000):
frac = root_two_expansion(x)
if len(digits(frac.numerator)) > len([*digits(frac.denominator)]):
if len([*digits(frac.numerator)]) > len([*digits(frac.denominator)]):
answer += 1
return answer

Expand Down
2 changes: 1 addition & 1 deletion python/p0357.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"""
from typing import Iterable

from lib.primes import is_prime, primes
from lib.factors import proper_divisors
from lib.primes import is_prime, primes


def divisors(n: int) -> Iterable[int]:
Expand Down

0 comments on commit ad3e77e

Please sign in to comment.