diff options
Diffstat (limited to 'progs/a196.py')
-rw-r--r-- | progs/a196.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/progs/a196.py b/progs/a196.py new file mode 100644 index 0000000..8787a9c --- /dev/null +++ b/progs/a196.py @@ -0,0 +1,6 @@ +def sum_Odd(n):
+ terms = (n + 1)//2
+ sum1 = terms * terms
+ return sum1
+def sum_in_Range(l,r):
+ return sum_Odd(r) - sum_Odd(l - 1)
\ No newline at end of file |