From a8f94175a805dff714a956b242c194d7ac22b05d Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 27 Nov 2023 13:50:43 +0100 Subject: [PATCH] vault backup: 2023-11-27 13:50:43 --- Algo/B2/Exercises/Repetitive tutorial.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Algo/B2/Exercises/Repetitive tutorial.md b/Algo/B2/Exercises/Repetitive tutorial.md index c320b2e..cddd208 100644 --- a/Algo/B2/Exercises/Repetitive tutorial.md +++ b/Algo/B2/Exercises/Repetitive tutorial.md @@ -214,6 +214,11 @@ def prime(n: int) -> int: raise Exception("prime: n<= 1") elif n % 2 == 0: return n == 2 + else: + d = 3 + while d*d <= n and n % d!= 0: + d += 2 + return d*d > n ## Exercise 3.3 ```python def quotient(a: int, b: int) -> int: