Write a function to find the sum of arithmetic progression.
def ap_sum(a,n,d):
  total = (n * (2 * a + (n - 1) * d)) / 2
  return total
<s>[INST]<<SYS>>Given a task and its code, generate test cases for the code.<</SYS>>Write a function to find the sum of arithmetic progression.
def ap_sum(a,n,d):
  total = (n * (2 * a + (n - 1) * d)) / 2
  return total[/INST]assert ap_sum(1,5,2)==25
assert ap_sum(2,6,4)==72
assert ap_sum(1,4,5)==34</s>