Write a program to find the sum of the given series 1+2+3+ . . . . . .(N terms) 
Example 1:
Input:
N = 1
Output: 1
Explanation: For n = 1, sum will be 1.
Example 2:
Input:
N = 5
Output: 15
Explanation: For n = 5, sum will be 15
+ 2 + 3 + 4 + 5 = 15.
Your Task:
Complete the function seriesSum() which takes single integer n, as input parameters and returns an integer denoting the answer. You don't need to print the answer or take inputs.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 <= N <= 10^{5}

Source: geeksforgeeks | Difficulty: EASY
Tags: Data structures

Mathematics

Starter code: #User function Template for python3



class Solution:



	

	def seriesSum(self,n):

	    # code here

 

Solutions:
class Solution:

	def seriesSum(self, n):
		return n * (n + 1) // 2


class Solution:

	def seriesSum(self, n):
		sum = 0
		sum = n * (n + 1) // 2
		return sum


class Solution:

	def seriesSum(self, n):
		mul = n * (n + 1)
		sum = round(mul / 2)
		return sum


class Solution:

	def seriesSum(self, n):
		sum = 0
		if n > 0:
			sum = (n - 1) / 2 * n + n
		return int(sum)


class Solution:

	def seriesSum(self, n):
		sum = n * (n + 1) / 2
		return int(sum)


class Solution:

	def seriesSum(self, n):
		n = n / 2 * (1 + n)
		m = int(n)
		return m


class Solution:

	def seriesSum(self, n):
		if n == 1:
			return n
		else:
			return n * (n + 1) // 2


class Solution:

	def seriesSum(self, n):
		ans = n * (n + 1) / 2
		return int(ans)


class Solution:

	def seriesSum(self, n):
		if n < 1 or n > 100000:
			return
		return n * (n + 1) // 2


class Solution:

	def seriesSum(self, n):
		x = int(n * (n + 1) / 2)
		return x


class Solution:

	def seriesSum(self, n):
		for i in range(n):
			return n * (n + 1) // 2


class Solution:

	def seriesSum(self, n):
		summ = 0
		if n == 1:
			return 1
		else:
			return int(n * (n + 1) / 2)


class Solution:

	def seriesSum(self, n):
		a = int(n * (n + 1) / 2)
		return a


class Solution:

	def seriesSum(self, n):
		p = int(n * (n + 1) / 2)
		return p