# Fungrim entry: bf877e

$\operatorname{xgcd}\!\left(1, b\right) = \left(1, \left|\operatorname{sgn}\!\left(\left(b - 1\right) \left(b + 1\right)\right)\right|, \operatorname{sgn}(b) \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}(b) \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}(z)$ Sign function
ZZ$\mathbb{Z}$ Integers
Source code for this entry:
Entry(ID("bf877e"),
Formula(Equal(XGCD(1, b), Tuple(1, 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.

2021-03-15 19:12:00.328586 UTC