Your last example that should yield cosh(x) had an incorrect numerator on the Prime example...you used e^x + e^y instead of e^x + e^-x.
EDIT
forget all of this ... my error, I read n! instead of n .....
Edited: 26 July 2013, 7:37 p.m. after one or more responses were posted
if n=1 the return is 1.
1!=1 and by definition 0!=1
Edited: 26 July 2013, 7:15 p.m.
Oops, you are right !
Never good to post after midnight :O
Edited: 26 July 2013, 7:27 p.m.