next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
TestIdeals :: adicExpansion

adicExpansion -- compute adic expansion

Synopsis

Description

adicExpansion(p,0) returns {0 }. If N is nonzero, then adicExpansion(p,N) returns a list in which the ith element is the coefficient of pi in the base p expansion of N.

i1 : 5==1*2^0+0*2^1+1*2^2

o1 = true
i2 : adicExpansion(2,5)

o2 = {1, 0, 1}

o2 : List

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 of size e in which the ith element is the coefficient of p-i-1 in the unique nonterminating base p expansion of x. For example, the non-terminating base 2 expansion of 1/2 is 1/2 = 0/2 + 1/4 + 1/8 + 1/16 + …, and so

i3 : adicExpansion(2,4,1/2)

o3 = {0, 1, 1, 1}

o3 : List

See also

Ways to use adicExpansion :