Would you elaborate a bit more on what your question is?
Are you wanting code to simplify the first element of p2
and p3
to be the second element of p2
and p3
, respectively?
Also, by "Gauss' formula" do you mean what's mentioned in the following: https://math.stackexchange.com/questions/2852717/understanding-gausss-product-formula-as-cited-in-golombs-shift-register-sequen.
It appears that p3[x]
is just p2[x, Infinity]
so only the code for p2
seems necessary.