$$f(x)=3^x \mod{17}$$

How to find the pre-image of the set if this function maps from real numbers to real numbers. What command would I use, to see the pre-image if the function would map from integers to integers.

It is easy to compute with mathematica, but the command to find the pre-image I cannot find.

What I tried, and there are no methods available to solve it:

Solve[y == 3^x - 17 Floor[3^x/17], x]

Output: enter image description here

  • 2
    $\begingroup$ Not sure why you'd want the pre-image for the reals. For integers, it's a discrete logarithm using MultiplicativeOrder like this: pri = Table[MultiplicativeOrder[3, 17, i], {i, 17 - 1}] and you can verify with Table[Mod[3^y, 17], {y, pri}] $\endgroup$
    – flinty
    May 8 at 16:42
  • 1
    $\begingroup$ You might also look at PowerMod e.g. PowerMod[3, x, 17] $\endgroup$
    – mikado
    May 8 at 16:44
  • $\begingroup$ Ok, but how to get it back, if I only know the function and the image for example. $\endgroup$
    – VLC
    May 8 at 16:51
  • 1
    $\begingroup$ Partial success: domain = -1 < u < 60; range = 3 < y < 5; Reduce[y == PiecewiseExpand[Mod[u, 17], domain] && domain && range /. u -> 3^x, {x}, {y}, Reals]. Let someone else take it from here. $\endgroup$
    – Michael E2
    May 8 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.