L1 = adicExpansion(p, N)
L2 = adicExpansion(p, e, x)
adicExpansion(p, 0) returns \{0\}. If $N$ is nonzero, then adicExpansion(p, N) returns a list in which the $i^{th}$ element is the coefficient of $p^{i-1}$ in the base $p$ expansion of $N$.
|
|
adicExpansion(p, e, 0) returns a list with $e$ elements, all of which are zero. If $x$ is nonzero, then adicExpansion(p, e, x) returns a list with $e$ elements in which the $i^{th}$ element is the coefficient of $p^{-i}$ in the unique nonterminating base $p$ expansion of $x$. For example, the non-terminating base $3$ expansion of $1/5$ is $1/5 = 0/3 + 1/9 + 2/27 + 1/81 + 0/243 + 1/729 + \cdots$, and so adicExpansion(3, 6, 1/5) returns the digits $0$, $1$, $2$, $1$, $0$, and $1$.
|
The object adicExpansion is a method function.