Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28495 views
License: GPL3
ubuntu2004
Function: factorback
Section: number_theoretical
C-Name: factorback2
Prototype: GDG
Description:
 (gen):gen      factorback($1)
 (gen,):gen     factorback($1)
 (gen,gen):gen  factorback2($1, $2)
Help: factorback(f,{e}): given a factorization f, gives the factored
 object back. If e is present, f has to be a vector of the same length, and
 we return the product of the f[i]^e[i].
Doc: gives back the factored object corresponding to a factorization. The
 integer $1$ corresponds to the empty factorization.

 If $e$ is present, $e$ and $f$ must be vectors of the same length ($e$ being
 integral), and the corresponding factorization is the product of the
 $f[i]^{e[i]}$.

 If not, and $f$ is vector, it is understood as in the preceding case with $e$
 a vector of 1s: we return the product of the $f[i]$. Finally, $f$ can be a
 regular factorization, as produced with any \kbd{factor} command. A few
 examples:
 \bprog
 ? factor(12)
 %1 =
 [2 2]

 [3 1]

 ? factorback(%)
 %2 = 12
 ? factorback([2,3], [2,1])   \\ 2^3 * 3^1
 %3 = 12
 ? factorback([5,2,3])
 %4 = 30
 @eprog
Variant: Also available is \fun{GEN}{factorback}{GEN f} (case $e = \kbd{NULL}$).