Official Rookie Mistake Discussion

Type your comment> @Artf7 said:

Nice challenge @willwam845!

@ngoctnq This is indeed weird in my opinion. It does work for ord = 6, or without specifying an order in my case

sage: discrete_log(Mod(23, 7 * 13), Mod(4, 7 * 13), ord=6)
5
sage: discrete_log(Mod(23, 7 * 13), Mod(4, 7 * 13))
5

But as the doc states: ord - integer (multiple of order of base, or None), any multiple should work… but it doesn’t…

I’m not totally clear about what the ord parameter actually exists for, though-- doesn’t sage automatically calculate it? edit: Ok nevermind, I think I figured out why one might want to do that (especially in this case)

And in @ngoctnq’s example, the integer 6*12 isn’t a multiple of the base, so why would it be expected to work? edit: order ≠ base, nevermind