# Fungrim entry: 1b47db

$\operatorname{xgcd}\!\left(-1, b\right) = \left(1, -\left|\operatorname{sgn}\!\left(\left(b - 1\right) \left(b + 1\right)\right)\right|, \operatorname{sgn}\!\left(b\right) \left(\operatorname{sgn}\!\left(b + 1\right) - \operatorname{sgn}\!\left(b - 1\right)\right)\right)$
Assumptions:$b \in \mathbb{Z}$
TeX:
\operatorname{xgcd}\!\left(-1, b\right) = \left(1, -\left|\operatorname{sgn}\!\left(\left(b - 1\right) \left(b + 1\right)\right)\right|, \operatorname{sgn}\!\left(b\right) \left(\operatorname{sgn}\!\left(b + 1\right) - \operatorname{sgn}\!\left(b - 1\right)\right)\right)

b \in \mathbb{Z}
Definitions:
Fungrim symbol Notation Short description
XGCD$\operatorname{xgcd}\!\left(a, b\right)$ Extended greatest common divisor
Abs$\left|z\right|$ Absolute value
Sign$\operatorname{sgn}\!\left(z\right)$ Sign function
ZZ$\mathbb{Z}$ Integers
Source code for this entry:
Entry(ID("1b47db"),
Formula(Equal(XGCD(-1, b), Tuple(1, Neg(Abs(Sign(Mul(Sub(b, 1), Add(b, 1))))), Mul(Sign(b), Sub(Sign(Add(b, 1)), Sign(Sub(b, 1))))))),
Variables(b),
Assumptions(Element(b, ZZ)))

## Topics using this entry

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2019-06-18 07:49:59.356594 UTC