B = Matrix([[1], [a2], [a3], [a4], [a5], [a6], [a7]])
C = top_matrix * B
print(solve(C, (a2, a3, a4, a5, a6, a7, p1, p2)))
Symbolic solution of equation system using Sympy with trivial solutions depending on symbols