----- Original message (slightly reformatted) ---- I want to find the value of h0, h1, h2, h3, h4 such that
(x - a1)*(x - a2)*(x - a3)*(h0 + h1*x^1 + h2*x^2 + h3*x^3 + h4*x^4 + x^5) is equal to (x + b)*g2 + (a*x + d) for some a, b, d, in GF(p). Below is my code which is unable to solve it a, b, d, a1, a2, a3, h0, h1, h2, h3, h4 = var('a b d a1 a2 a3 h0 h1 h2 h3 h4') RHS = (x - a1)*(x - a2)*(x - a3)*(h0 + h1*x^1 + h2*x^2 + h3*x^3 + h4*x^4 + x^5) g2 = x^7 + 74604*x^6 + 351974*x^5 + 18952*x^4 + 148817*x^3 + 256076*x^2 + 168356*x + 278165 LHS = (x + b)*g2 + (a*x + d) Coeff = RHS.coefficients(x, sparse=False) print(solve(RHS == LHS, h0, h1, h2, h3, h4)) ----- - What is the value of p that you want to work with? Or is p also an unknown? - Why do you define "Coeff"? You don't seem to use it. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.