A hypergeometric series
Mathematica's
Table[2 HypergeometricPFQ[{-n+1,2-n},{2},-1],{n,0,46}]
as well as Maple's
seq(round(evalf(2*hypergeom([-n+1,2-n],[2],-1),100)),n=0..46);
lead to
1, 2, 2, 0, -2, 0, 4, 0, -10, ... https://oeis.org/A182122
How can I compute this sequence with Sage?
A182122 = lambda n: 2*hypergeometric([-n+1,2-n],[2],-1)
[A182122(n).n(100) for n in (0..46)]
Unfortunately this was not successful.
Addition:
This is not an isolated problem. I give a second example: Motzkin sums http://oeis.org/A005043
A005043 = lambda n: (-1)^n*hypergeometric([-n,1/2],[2],4)
[Integer(A005043(n).n(100)) for n in (0..29)]
In this case there is this 'workaround':
A005043 = lambda n: (-1)^n*jacobi_P(n,1,-n-3/2,-7)/(n+1)
[Integer(A005043(n).n(100)) for n in (0..29)]
And Maxima gets it right too:
maxima_calculus('makelist((-1)^n*hypergeometric([-n,1/2],[2],4),n,0,29)')
looks like a bug in Maxima interface to me (or perhaps the options Sage starts Maxima with are causing this). (EDIT, nope, it has nothing to do with Maxima, it's mpmath)
you can do the last line as sage: [(-1)^n*maxima_calculus.hgfred([-n,1/2],[2],4) for n in [0..29]]