What is the summation formula of arithmetic sequence

What is the summation formula of arithmetic sequence

S=n(a1+an)/2
S=a1n+n(n-1)d/2
S is the sum
N is the number of items
A1 is the prime minister
An is the last term
D is the tolerance
The above formula is only for arithmetic sequence