Haskell (too many bytes)
Using only operations on lists and Raymond Manzoni's resultresult:
c n = last $ map numerator $ zipWith (*) (scanl (*) (1) [2,3..]) (intersperse 0 $ foldr (.) id (replicate n (\xs->(xs ++ [(1%(1+2*length xs)) * (sum (zipWith (*) xs (reverse xs)))]))) [1])
Unfortunately, this overflows for modest values of n
, as it uses Int
values. I will try to fix the problem using Integer
values. Until then, suggestions are welcome.