Calculate the middle number of a row of the pascal triangle Write a function that calculates a row of the pascal triangle and returns the middle number, if there are 2 it should return their sum.

Example:

5


would return

20


Example 2:

4


would return

6


EDIT:

To be clear:

a) if the number inputted is odd then find then return the middle number of a row on the pascal triangle.

b) if the number inputted is even then find the two middle numbers of the row on the pascal triangle and sum the 2 numbers.

The nth row is using zero-based indicies. For numbers other than zero, this is the row which has its second number as the number inputted into the function.
Ohm, 6 bytes

½⌠Ddac


Try it online!

If the number is even it is you calculate (n n/2) if it is odd (n+1 (n+1)/2)

         Inplicit input
½        Half
 ⌠       Ceil
  D      Duplicate on stack
   d     x2
    a    Swap on stack
     c   Binomial