From 84e93788146d8659e348d87a34b7056f95aa3867 Mon Sep 17 00:00:00 2001 From: anushac13 Date: Sun, 26 Oct 2025 11:15:23 +0530 Subject: [PATCH 1/4] Create sum of sqaures of n natural numbers --- maths/series/sum of sqaures of n natural numbers | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 maths/series/sum of sqaures of n natural numbers 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 From 983ad4d2ad5ed7696f1ee34d9af582e346e1c9cf Mon Sep 17 00:00:00 2001 From: anushac13 Date: Sun, 26 Oct 2025 11:38:14 +0530 Subject: [PATCH 2/4] Create sum of sqaures of n natural numbers This find the sum of n natural numbers --- maths/series/sum of sqaures of n natural numbers | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/maths/series/sum of sqaures of n natural numbers b/maths/series/sum of sqaures of n natural numbers index e69de29bb2d1..68cd86f35cab 100644 --- a/maths/series/sum of sqaures of n natural numbers +++ b/maths/series/sum of sqaures of n natural numbers @@ -0,0 +1,15 @@ +#find sum of n natural numbers +class sum_of_squares: + def get_square_of_series(self,n): + self.n=n + if n>0: + r=(n*(n+1)*((2*n)+1))/6 + print(f"The sum of squares of the first {n} natural numbers is {r}") + else: + print("Kindly enter a natural number!") + + + +solution1=sum_of_squares() +a=int(input("Enter a natural number to find sum of sqaures upto that number:")) +solution1.get_square_of_series(a) \ No newline at end of file From 9ccd1ad19a896433bf408bbeb7610bb33af7450c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 06:16:12 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/series/sum of sqaures of n natural numbers | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maths/series/sum of sqaures of n natural numbers b/maths/series/sum of sqaures of n natural numbers index 68cd86f35cab..cb8a574806ed 100644 --- a/maths/series/sum of sqaures of n natural numbers +++ b/maths/series/sum of sqaures of n natural numbers @@ -7,9 +7,9 @@ class sum_of_squares: print(f"The sum of squares of the first {n} natural numbers is {r}") else: print("Kindly enter a natural number!") - - - + + + solution1=sum_of_squares() a=int(input("Enter a natural number to find sum of sqaures upto that number:")) solution1.get_square_of_series(a) \ No newline at end of file From a821124b2fb1dbc2708811f83790dc1dffd9de62 Mon Sep 17 00:00:00 2001 From: anushac13 Date: Sun, 26 Oct 2025 15:18:55 +0530 Subject: [PATCH 4/4] Update sum of sqaures of n natural numbers --- maths/series/sum of sqaures of n natural numbers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/series/sum of sqaures of n natural numbers b/maths/series/sum of sqaures of n natural numbers index 68cd86f35cab..fa36151a6957 100644 --- a/maths/series/sum of sqaures of n natural numbers +++ b/maths/series/sum of sqaures of n natural numbers @@ -11,5 +11,5 @@ class sum_of_squares: solution1=sum_of_squares() -a=int(input("Enter a natural number to find sum of sqaures upto that number:")) +a=int(input("Enter a natural number to find sum of squares upto that number:")) solution1.get_square_of_series(a) \ No newline at end of file