[pre-commit.ci] pre-commit autoupdate (#11473)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) * Fix ruff issues * Fix ruff issues --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
committed by
GitHub
parent
6882a8b808
commit
716bdeb68b
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -85,11 +85,10 @@ def validate(n: int) -> bool:
|
||||
>>> validate(3797)
|
||||
True
|
||||
"""
|
||||
if len(str(n)) > 3 and (
|
||||
not is_prime(int(str(n)[-3:])) or not is_prime(int(str(n)[:3]))
|
||||
):
|
||||
return False
|
||||
return True
|
||||
return not (
|
||||
len(str(n)) > 3
|
||||
and (not is_prime(int(str(n)[-3:])) or not is_prime(int(str(n)[:3])))
|
||||
)
|
||||
|
||||
|
||||
def compute_truncated_primes(count: int = 11) -> list[int]:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -43,7 +43,7 @@ def solution(limit: int = 1_000_000) -> int:
|
||||
ind = np.arange(2 * i, limit + 1, i) # indexes for selection
|
||||
phi[ind] -= phi[ind] // i
|
||||
|
||||
return np.sum(phi[2 : limit + 1])
|
||||
return int(np.sum(phi[2 : limit + 1]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user