# adicDigit -- compute a digit of the non-terminating expansion of a number in the unit interval in a given base

## Synopsis

• Usage:
• Inputs:
• p, an integer, greater than 1; the desired base
• e, an integer, positive, which specifies which digit is desired
• x, , in the interval [0,1]; the number whose digit is to be computed
• L, a list, consisting of rational numbers in the interval [0,1] whose digits are to be computed
• Outputs:
• d, an integer, the e^{th} digit of the base p expansion of x
• D, a list, consisting of the e^{th} digits of the base p expansions of the elements of L

## Description

The command adicDigit(p, e, 0) returns 0. If $x$ is a rational number in the interval (0,1], then adicDigit(p, e, x) returns the coefficient of $p^{-e}$ in the non-terminating base $p$ expansion of $x$.

 i1 : adicDigit(5, 4, 1/3) o1 = 3

If $L$ is a list of rational numbers in the unit interval, adicDigit(p, e, L) returns a list containing the $e^{th}$ digits (base $p$) of the elements of $L$.

 i2 : adicDigit(5, 4, {1/3, 1/7, 2/3}) o2 = {3, 4, 1} o2 : List