diff --git a/tools/int_seq.py b/tools/int_seq.py index c9e93af..bbaeb33 100644 --- a/tools/int_seq.py +++ b/tools/int_seq.py @@ -27,4 +27,4 @@ def triangular(n: int) -> int: a(n) = binomial(n+1,2) = n*(n+1)/2 = 0 + 1 + 2 + ... + n 0, 1, 3, 6, 10, 15, ... """ - return int(n * (n + 1) / 2) + return n * (n + 1) // 2