NumberDecompose
NumberDecompose[x,{u1,…,un}]
returns a list of coefficients {c1,…,cn} of a decomposition of the number x in the basis {u1,…,un}.
Details
- The basis {u1,…,un} must be a list of nonincreasing positive numbers.
- The result has the same length of the basis, even if the initial coefficients are zero.
- The coefficients {c1,…,cn-1} are integers, but cn will be exact or not depending on the precision of x and the basis elements.
- NumberDecompose[x,units] for negative x is equivalent to -NumberDecompose[-x,units].
Examples
open allclose allBasic Examples (2)
Scope (3)
Applications (2)
Properties & Relations (7)
The result of NumberDecompose is a list of non-negative numbers for a positive input:
The result is a list of nonpositive numbers for a negative input:
NumberCompose is the inverse of NumberDecompose:
DMSList is a special case of NumberDecompose:
The length of the result equals the length of the basis:
For integers, NumberDecompose returns the last solution found by FrobeniusSolve:
IntegerDigits is equivalent to NumberDecompose for an adequate choice of basis of units:
IntegerDigits with a MixedRadix specification performs a NumberDecompose operation:
Text
Wolfram Research (2015), NumberDecompose, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberDecompose.html.
CMS
Wolfram Language. 2015. "NumberDecompose." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumberDecompose.html.
APA
Wolfram Language. (2015). NumberDecompose. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumberDecompose.html