# extracting digits in p-adic expansion

Here is a maybe naive question.

I am working over an unramified extansion of $\mathbb{Z}_p$ (let say of degree 2), say R.(c) = Zq(7^2) so that every element of R is written as ($a_0$ c + $b_0$) + ($a_1$ *c + $b_1$) *7 + ($a_2$c + $b_2$)*7^2 + $\ldots$ .

Is there a command to extract each of the $a_i$ or $b_i$ individually ?

edit retag close merge delete

Sort by » oldest newest most voted
sage: Z9.<c> = Zq(9)
sage: z = Z9.random_element(); z
2*c + (c + 2)*3 + (2*c + 2)*3^2 + (2*c + 2)*3^3 + 2*3^4 + (2*c + 1)*3^5 + (2*c + 1)*3^6 + (c + 2)*3^7 + c*3^8 + (2*c + 2)*3^10 + (c + 2)*3^11 + (2*c + 2)*3^13 + 2*3^14 + (2*c + 2)*3^15 + (c + 1)*3^16 + 2*c*3^17 + (2*c + 1)*3^18 + c*3^19 + O(3^20)
sage: z.list()
[[0, 2], [2, 1], [2, 2], [2, 2], , [1, 2], [1, 2], [2, 1], [0, 1], [], [2, 2], [2, 1], [], [2, 2], , [2, 2], [1, 1], [0, 2], [1, 2], [0, 1]]


But note that here the coefficient of $3^9$, which is zero, yields [] as its list of coefficients. Similarly, for the coefficient of $3^4$, which is $2$, we get .

more