PROBLEM LINK:
Author, Tester, Editorialist: Vaibhav Gupta
PROBLEM
Find the k^{th} generator greater than a given number a of a multiplicative group Z_{p}.
QUICK EXPLANATION
A set of generators (g_{1},…,g_{n}) is a set of group elements such that possibly repeated application of the generators on themselves and each other is capable of producing all the elements in the group. Cyclic groups can be generated as powers of a single generator.
EXPLANATION
Algorithm for finding the generator of a cyclic group.
INPUT: a cyclic group G of order n, and the prime factorization n = p_{1}^{e1}p_{2}^{e2} · · · p_{k}^{ek}.
OUTPUT: a generator α of G.

Choose a random element α in G.

For i from 1 to k do the following:
2.1 Compute b ← α^{n/pi} .
2.2 If b = 1 then go to step 1.
 Return(α).