To find a number
such that
(the discrete log of
), you can call Sage's
log
command:
sage: r = Integers(125) sage: b = r.multiplicative_generator()^3 sage: a = b^17 sage: a.log(b) 17
This also works over finite fields:
sage: FF = FiniteField(16,"a") sage: a = FF.gen() sage: c = a^7 sage: c.log(a) 7
See About this document... for information on suggesting changes.