Some formulas for the central trinomial and Motzkin numbers