Base - Maple Help

Ordinals

 Base
 convert ordinals between bases

 Calling Sequence Base(a, b, output=o)

Parameters

 a, b - ordinals, nonnegative integers, or polynomials with positive integer coefficients o - (optional) literal keyword; either list (default) or inert

Returns

 • By default, a list of pairs $\left[\left[{e}_{1},{c}_{1}\right],\left[{e}_{2},{c}_{2}\right],\mathrm{...}\right]$, where each ${e}_{i}$ and ${c}_{i}$ is either an ordinal data structure, a nonnegative integer, or a polynomial with positive integer coefficients, and $0\prec {c}_{i}\prec b$ for all $i$, where $\prec$ is the ordering of ordinals.
 • If output=inert is specified, then an inert sum of products of ordinal numbers using the inert operators &+, &. and &^, respectively, is returned.

Description

 • The Base(a,b) calling sequence expresses the ordinal $a$ in terms of powers of the base $b$ instead of the standard base $\mathbf{\omega }$.
 • By default, the result is returned as a list of pairs $\left[\left[{e}_{1},{c}_{1}\right],\left[{e}_{2},{c}_{2}\right],\mathrm{...}\right]$ such that

$a={b}^{{e}_{1}}\cdot {c}_{1}+{b}^{{e}_{2}}\cdot {c}_{2}+\cdots$

 ${e}_{1}\succ {e}_{2}\succ \cdots$ and  $0\prec {c}_{i}\prec b$ for all $i$. Use output=inert to return the above sum-of-products form instead; see the Returns section.
 • This representation is unique if $b\succcurlyeq 2$. If $b=0$ or $b=1$, a division by zero error is raised.
 • The exponents ${e}_{i}$ are not converted recursively; they are still represented in Cantor normal form (with respect to base $\mathbf{\omega }$).
 • If $b\preccurlyeq \mathbf{\omega }$, then all coefficients ${c}_{i}$ are either positive integers or polynomials with positive integer coefficients. In particular, if $b=\mathbf{\omega }$, then the ${e}_{i}$ and ${c}_{i}$ are just the exponents and coefficients of $a$ in the Cantor normal form. Otherwise, if $b\succ \mathbf{\omega }$, some of the coefficients will be proper ordinals $\succcurlyeq \mathbf{\omega }$.
 • The output representation is computed by calling the Log command repeatedly: if $l,q,r=\mathrm{Log}\left(a,b\right)$, then $\mathrm{Base}\left(a,b\right)=\left[\left[l,q\right],\mathrm{op}\left(\mathrm{Base}\left(r,b\right)\right)\right]$.
 • If one of a and b is a parametric ordinal and the logarithm cannot be taken, an error is raised.

Examples

 > $\mathrm{with}\left(\mathrm{Ordinals}\right)$
 $\left[{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{<}}{,}{\mathrm{<=}}{,}{\mathrm{Add}}{,}{\mathrm{Base}}{,}{\mathrm{Dec}}{,}{\mathrm{Decompose}}{,}{\mathrm{Div}}{,}{\mathrm{Eval}}{,}{\mathrm{Factor}}{,}{\mathrm{Gcd}}{,}{\mathrm{Lcm}}{,}{\mathrm{LessThan}}{,}{\mathrm{Log}}{,}{\mathrm{Max}}{,}{\mathrm{Min}}{,}{\mathrm{Mult}}{,}{\mathrm{Ordinal}}{,}{\mathrm{Power}}{,}{\mathrm{Split}}{,}{\mathrm{Sub}}{,}{\mathrm{^}}{,}{\mathrm{degree}}{,}{\mathrm{lcoeff}}{,}{\mathrm{log}}{,}{\mathrm{lterm}}{,}{\mathrm{\omega }}{,}{\mathrm{quo}}{,}{\mathrm{rem}}{,}{\mathrm{tcoeff}}{,}{\mathrm{tdegree}}{,}{\mathrm{tterm}}\right]$ (1)
 > $a≔\mathrm{Ordinal}\left(\left[\left[5,1\right],\left[4,4\right],\left[2,2\right],\left[1,1\right],\left[0,3\right]\right]\right)$
 ${a}{≔}{{\mathbf{\omega }}}^{{5}}{+}{{\mathbf{\omega }}}^{{4}}{\cdot }{4}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{2}{+}{\mathbf{\omega }}{+}{3}$ (2)
 > $b≔\mathrm{Ordinal}\left(\left[\left[2,1\right],\left[0,3\right]\right]\right)$
 ${b}{≔}{{\mathbf{\omega }}}^{{2}}{+}{3}$ (3)
 > $\mathrm{Base}\left(a,b\right)$
 $\left[\left[{2}{,}{\mathbf{\omega }}{+}{3}\right]{,}\left[{1}{,}{{\mathbf{\omega }}}^{{2}}{+}{2}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (4)
 > $l,q,r≔\mathrm{Log}\left(a,b\right)$
 ${l}{,}{q}{,}{r}{≔}{2}{,}{\mathbf{\omega }}{+}{3}{,}{{\mathbf{\omega }}}^{{4}}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{2}{+}{\mathbf{\omega }}{+}{3}$ (5)
 > $\mathrm{Base}\left(r,b\right)$
 $\left[\left[{1}{,}{{\mathbf{\omega }}}^{{2}}{+}{2}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (6)
 > $\mathrm{Base}\left(a,b,\mathrm{output}=\mathrm{inert}\right)$
 ${\left({{\mathbf{\omega }}}^{{2}}{+}{3}\right)}^{{2}}{\mathbf{\cdot }}\left({\mathbf{\omega }}{+}{3}\right){\mathbf{+}}\left({{\mathbf{\omega }}}^{{2}}{+}{3}\right){\mathbf{\cdot }}\left({{\mathbf{\omega }}}^{{2}}{+}{2}\right){\mathbf{+}}\left({\mathbf{\omega }}{+}{3}\right)$ (7)
 > $\mathrm{value}\left(\right)$
 ${{\mathbf{\omega }}}^{{5}}{+}{{\mathbf{\omega }}}^{{4}}{\cdot }{4}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{2}{+}{\mathbf{\omega }}{+}{3}$ (8)

Parametric examples.

 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}+2+x\right)$
 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}+3+x\right)$
 $\left[\left[{2}{,}{\mathbf{\omega }}{+}{3}\right]{,}\left[{1}{,}{{\mathbf{\omega }}}^{{2}}{+}{2}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (9)
 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}+3+x,\mathrm{output}=\mathrm{inert}\right)$
 ${\left({{\mathbf{\omega }}}^{{2}}{+}\left({3}{+}{x}\right)\right)}^{{2}}{\mathbf{\cdot }}\left({\mathbf{\omega }}{+}{3}\right){\mathbf{+}}\left({{\mathbf{\omega }}}^{{2}}{+}\left({3}{+}{x}\right)\right){\mathbf{\cdot }}\left({{\mathbf{\omega }}}^{{2}}{+}{2}\right){\mathbf{+}}\left({\mathbf{\omega }}{+}{3}\right)$ (10)
 > $\mathrm{value}\left(\right)$
 ${{\mathbf{\omega }}}^{{5}}{+}{{\mathbf{\omega }}}^{{4}}{\cdot }{4}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{2}{+}{\mathbf{\omega }}{+}{3}$ (11)
 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}+2\right)$
 $\left[\left[{2}{,}{\mathbf{\omega }}{+}{4}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (12)
 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}+1\right)$
 $\left[\left[{2}{,}{\mathbf{\omega }}{+}{4}\right]{,}\left[{1}{,}{1}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (13)
 > $\mathrm{Base}\left(a,{\mathrm{\omega }}^{2}\right)$
 $\left[\left[{2}{,}{\mathbf{\omega }}{+}{4}\right]{,}\left[{1}{,}{2}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (14)
 > $\mathrm{Base}\left(a,\mathrm{\omega }+4+x\right)$
 $\left[\left[{4}{,}{\mathbf{\omega }}{+}{3}\right]{,}\left[{3}{,}{\mathbf{\omega }}\right]{,}\left[{2}{,}{1}\right]{,}\left[{1}{,}{\mathbf{\omega }}\right]{,}\left[{0}{,}{\mathbf{\omega }}{+}{3}\right]\right]$ (15)
 > $\mathrm{Base}\left(a,\mathrm{\omega }+3\right)$
 $\left[\left[{5}{,}{1}\right]{,}\left[{3}{,}{\mathbf{\omega }}\right]{,}\left[{2}{,}{1}\right]{,}\left[{1}{,}{\mathbf{\omega }}{+}{1}\right]\right]$ (16)
 > $\mathrm{Base}\left(a,\mathrm{\omega }+2\right)$
 $\left[\left[{5}{,}{1}\right]{,}\left[{4}{,}{1}\right]{,}\left[{3}{,}{\mathbf{\omega }}\right]{,}\left[{2}{,}{1}\right]{,}\left[{1}{,}{\mathbf{\omega }}{+}{1}\right]{,}\left[{0}{,}{1}\right]\right]$ (17)
 > $\mathrm{Base}\left(a,\mathrm{\omega }+1\right)$
 $\left[\left[{5}{,}{1}\right]{,}\left[{4}{,}{2}\right]{,}\left[{3}{,}{\mathbf{\omega }}\right]{,}\left[{2}{,}{2}\right]{,}\left[{0}{,}{2}\right]\right]$ (18)
 > $\mathrm{Base}\left(a,\mathrm{\omega }\right)=\mathrm{op}\left(a\right)$
 $\left[\left[{5}{,}{1}\right]{,}\left[{4}{,}{4}\right]{,}\left[{2}{,}{2}\right]{,}\left[{1}{,}{1}\right]{,}\left[{0}{,}{3}\right]\right]{=}\left[\left[{5}{,}{1}\right]{,}\left[{4}{,}{4}\right]{,}\left[{2}{,}{2}\right]{,}\left[{1}{,}{1}\right]{,}\left[{0}{,}{3}\right]\right]$ (19)

When the base is constant.

 > $\mathrm{Base}\left(a,5\right)$
 $\left[\left[{\mathbf{\omega }}{\cdot }{5}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{4}{,}{4}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{,}{2}\right]{,}\left[{\mathbf{\omega }}{,}{1}\right]{,}\left[{0}{,}{3}\right]\right]$ (20)
 > $\mathrm{Base}\left(a,5,\mathrm{output}=\mathrm{inert}\right)$
 ${\left({5}\right)}^{{\mathbf{\omega }}{\cdot }{5}}{\mathbf{+}}{\left({5}\right)}^{{\mathbf{\omega }}{\cdot }{4}}{\mathbf{\cdot }}{4}{\mathbf{+}}{\left({5}\right)}^{{\mathbf{\omega }}{\cdot }{2}}{\mathbf{\cdot }}{2}{\mathbf{+}}{\left({5}\right)}^{{\mathbf{\omega }}}{\mathbf{+}}{3}$ (21)
 > $\mathrm{Base}\left(a,4\right)$
 $\left[\left[{\mathbf{\omega }}{\cdot }{5}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{4}{+}{1}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{,}{2}\right]{,}\left[{\mathbf{\omega }}{,}{1}\right]{,}\left[{0}{,}{3}\right]\right]$ (22)
 > $\mathrm{Base}\left(a,3\right)$
 $\left[\left[{\mathbf{\omega }}{\cdot }{5}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{4}{+}{1}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{4}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{,}{2}\right]{,}\left[{\mathbf{\omega }}{,}{1}\right]{,}\left[{1}{,}{1}\right]\right]$ (23)
 > $\mathrm{Base}\left(a,2\right)$
 $\left[\left[{\mathbf{\omega }}{\cdot }{5}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{4}{+}{2}{,}{1}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{+}{1}{,}{1}\right]{,}\left[{\mathbf{\omega }}{,}{1}\right]{,}\left[{1}{,}{1}\right]{,}\left[{0}{,}{1}\right]\right]$ (24)

If both $a$ and $b$ are integers, this is the usual base $b$ representation.

 > $100=\mathrm{Base}\left(100,3,\mathrm{output}=\mathrm{inert}\right)$
 ${100}{=}{\left({3}\right)}^{{5}}{\mathbf{+}}{\left({3}\right)}^{{3}}{\mathbf{\cdot }}{2}{\mathbf{+}}{3}$ (25)

Example with nonconstant exponents.

 > $b≔\mathrm{\omega }·2+3$
 ${b}{≔}{\mathbf{\omega }}{\cdot }{2}{+}{3}$ (26)
 > ${b}^{b}$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{2}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{1}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}}{\cdot }{3}$ (27)
 > $a≔\mathrm{Dec}\left(\right)+x$
 ${a}{≔}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{2}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{1}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{+}{1}}{+}{x}$ (28)
 > $r≔\mathrm{Base}\left(a,b\right)$
 ${r}{≔}\left[\left[{\mathbf{\omega }}{\cdot }{2}{+}{2}{,}{\mathbf{\omega }}{\cdot }{2}{+}{2}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{+}{1}{,}{\mathbf{\omega }}{\cdot }{2}{+}{2}\right]{,}\left[{\mathbf{\omega }}{\cdot }{2}{,}{\mathbf{\omega }}{\cdot }{2}{+}{2}\right]{,}\left[{\mathbf{\omega }}{,}{\mathbf{\omega }}\right]{,}\left[{0}{,}{x}\right]\right]$ (29)
 > $\mathrm{+}\left(\mathrm{seq}\left({b}^{r\left[i,1\right]}·r\left[i,2\right],i=1..\mathrm{nops}\left(r\right)\right)\right)$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{2}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}{+}{1}}{\cdot }{6}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{\cdot }{2}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{\mathbf{\omega }}{+}{1}}{+}{x}$ (30)

Compatibility

 • The Ordinals[Base] command was introduced in Maple 2015.