Newton's identities in Sage
I'm combining netwon's identities with le verrier's algorithm
I need some help coding the following on python.
$c_k=\frac{-1}{k}(s_k+c_1s_{k-1}+c_2s_{k-2}+\dots+c_{k-1}s_1)$
where $s_k=Tr(A^k)$, for some square matrix A, $\forall k=1,2,3,\dots,n$
So, i'd like to type in $c(k)$ and python spits out the value for $c_k$ as defined above.
can somebody help me with this?
EDIT: I need further help (SEE BELOW)
what i want to do is add some more code (to tobias welch's answer) that will for example calculate $c(4,A)$, but i dont want sage to do the calculations for $A^4$ again - i want it to do $A^3\cdot A$ i.e. use the fact that it already calculated $A^3$ for $c(3,A)$ to help reduce the calculation time. So, i guess i want what im after is a recurrence relation.