1

I am trying to find when the following is true:

Let $H =(10k)^b \bmod 6(p-1)$

Let $J = 10^{H} \bmod 9p$

For some prime $p > 5$ and large $k,b$.

I am trying to find when $J$ is equal to $1$. However I have no idea how to even begin compressing this into something a little more palatable. Right now I am using binary exponentiation to compute $a^b \bmod m$ in general but I am wondering if there is a simpler way to determine when $J = 1$ (i.e. if there is some way to tell which combinations of variables will render this true).

Equivalently:

When does $10^{(10k)^b} \bmod 9p$ equal $1$?

1 Answers1

0

Since $\,10^H\equiv 1^H\equiv 1\pmod 9\,$ it suffices to verify that $\,10^H\equiv 1\pmod p,\ $ where we have $\,10^H\equiv 1\equiv 10^{\,p-1}$ $\iff$ $10^{(H,p-1)}\equiv 1.\,$ Therfore it suffices to check the smaller power $\,(H,p\!-\!1) = (H\ {\rm mod}\ p\!-\!1,\, p\!-\!1),\,$ which can be done by repeated squaring. That and the gcd and mod operations are all very fast.

There is no general formula to compute the answer - you will need to do some analogous computation. If you have further information available then the computation may be quicker, e.g. if you know that $\,10\,$ has order $\,n\,$ modulo $\,p\,$ then you need only test if $\,n\mid H.\,$ Thus if are performing many tests mod $\,p\,$ then it might be more efficient to first compute the order of $\,10.$ See here for order computation algorithms and complexity analysis.

Bill Dubuque
  • 272,048
  • Does this apply at all the the equivalent statement I put at the end of my post, that might be a little clearer than the $J$ and $H$ functions? – user354261 Jul 15 '16 at 20:05
  • @user354261 Yes, that's the precisely statement that I consider above. – Bill Dubuque Jul 15 '16 at 20:06
  • So you're saying that this is the same as checking if $10^{\gcd((10k)^b \bmod (p-1),~ p-1)} \equiv 1 \bmod p$? – user354261 Jul 15 '16 at 20:35
  • (the reason I ask is because it doesn't seem to make things much simpler than the first half of my post, where I separate the exponent into its own group to exponentiate quickly and then use that the new exponent for 10 and do that exponentiation quickly as well) – user354261 Jul 15 '16 at 20:48
  • It can be much simpler, e.g. the gcd may often be $1$ (or small). I presume the first half is an attempt to answer the question in your final sentence, but where did the $6$ in $6(p-1)$ come from? – Bill Dubuque Jul 15 '16 at 20:52
  • A simplification from $\phi(9p)$. Since $p>5$, we have $\gcd(9, p) = 1$ so $\phi(9p) = \phi(9)\phi(p) = 6(p-1)$ – user354261 Jul 15 '16 at 20:53
  • Ah, you're working mod $,9p.,$ not mod $,p.,$ But you only need to test mod $p$ since it is always true mod $,9,$ by $10\equiv 1.,$ – Bill Dubuque Jul 15 '16 at 20:57
  • I feel like there has got to be a way to take advantage of the fact that $10k$ is in the exponent of this expression, which also has a base of $10$. I have tried to apply Fermat's and Euler's Theorem to this but I can't tell if it just makes it more complicated. – user354261 Jul 15 '16 at 21:11
  • If $\ 10k\equiv \pm1 \pmod{p-1},$ then computing $,(10k)^b \equiv (\pm1)^b \pmod{p-1},$ is trivial. Otherwise generally it is no simpler to exponentiate than any other integer. – Bill Dubuque Jul 15 '16 at 21:23
  • Could you not simplify this if you had the multiplicative order of $10$ modulo $p$? – user51819 Jul 15 '16 at 22:26