diff --git a/maths/series/sum of sqaures of n natural numbers b/maths/series/sum of sqaures of n natural numbers new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/maths/series/sum_ofsqauresof_nnaturalnumbers.py b/maths/series/sum_ofsqauresof_nnaturalnumbers.py new file mode 100644 index 000000000000..babd6c9af4f5 --- /dev/null +++ b/maths/series/sum_ofsqauresof_nnaturalnumbers.py @@ -0,0 +1,11 @@ +class squares_natural_numbers: + def __init__(self, n): + self.n = n + + def get(self): + a = (self.n * (self.n + 1) * (2 * self.n + 1)) / 6 + print("The sum of the squares of the first", self.n, "natural numbers is", a) + + +sol = squares_natural_numbers(2) +sol.get()