From 78849a74378f858a0e30db3326402236fc71070e Mon Sep 17 00:00:00 2001 From: Byte Bender <136265142+BYT-Bender@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:28:50 +0530 Subject: [PATCH] Update sum_of_squares.py --- maths/sum_of_squares.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maths/sum_of_squares.py b/maths/sum_of_squares.py index 1af5d0b8b..d5265153e 100644 --- a/maths/sum_of_squares.py +++ b/maths/sum_of_squares.py @@ -4,6 +4,8 @@ This script demonstrates the implementation of the sum of squares of the first n The function takes an integer n as input and returns the sum of squares from 1 to n using the formula n(n + 1)(2n + 1) / 6. This formula computes the sum efficiently without the need for iteration. + +https://www.cuemath.com/algebra/sum-of-squares/ """ def sum_of_squares(n: int) -> int: