ListPlot[Table[(2^x), {x, 0, 20}]]

Clear[DiskreterLogarithmus]
\(DiskreterLogarithmus[y_, a_] := 
      Module[{z, zähler}, 
z = y; 
        zähler = 0; 
While[
          IntegerQ[z] && z > 1, 
z = z/a; 
          zähler = zähler + 1]; 
If[
          Not[IntegerQ[z]], 
          Return["diskreter Logarithmus existiert nicht"]]; 
zähler
]\)

DiskreterLogarithmus[(5^1000), 5]

DiskreterLogarithmus[(5^1000) + 1, 5]

ListPlot[Table[Mod[(2^x), 1009], {x, 0, 1008}]]

ListPlot[Table[Mod[(2^x), 10007], {x, 0, 10006}]]

NextPrime[n_ ] := n + 1 /; PrimeQ[n + 1]
NextPrime[n_ ] := NextPrime[n + 1]

p = NextPrime[(10^20)]

(b = PowerMod[2, 12345678, p]) // Timing

Solve[{(2^x) == b, Modulus == p}, x]

MultiplicativeOrder[2, p, b] // Timing