First time here? Check out the FAQ!
answered 3 years ago
The given conditions imply that k0 and j are simply the remainder and quotient of division of k by p-1. Correspondingly, they can be computed as:
k0
j
k
p-1
j, k0 = k.quo_rem(p-1)