# Revision history [back]

### 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);


1, 2, 2, 0, -2, 0, 4, 0, -10, ...   https://oeis.org/A182122


How can I compute this sequence with Sage?

A = lambda n: 2*hypergeometric([-n+1,2-n],[2],-1)
[A(n).n(100) for n in (0..46)]


Unfortunately this was not successful.

### 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);


1, 2, 2, 0, -2, 0, 4, 0, -10, ...   https://oeis.org/A182122


How can I compute this sequence with Sage?

A A182122 = lambda n: 2*hypergeometric([-n+1,2-n],[2],-1)
[A(n).n(100) [A182122(n).n(100) for n in (0..46)]


Unfortunately this was not successful.

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 (2..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)]


### 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);


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.

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 (2..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)')


### 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);


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.

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 (2..29)]
(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)')