3

A method to determine the base in $M=a^n$ knowing only $M$.

The proposed method is based on the following steps:

  1. Calculation of $M^2$.
  2. Calculation of $(2^{M^2}−2) \mod (2 \times M^2) = X$.
  3. Determination of a through $\gcd(X,M)=a$.

from the tests I have carried out (with a prime number). The exceptions are only Wieferich primes, but I don't have a fast computer, so I could be wrong.

Are there any other exceptions with a prime number?

M. A.
  • 1,774
  • Given a factorizable number N, for which A does this gcd{[(A^(N^2)-A) mod (A*N^2)] , N}

    return a factor of $N$ ?

    I found that if it works for a generic A it works for another A= p-A || p-1 || p || p+1 || p+A ; where p is a factor of N

    – Alberico Lepore Oct 19 '24 at 18:02
  • In what interval, with maximum density of A, should one look for the A? – Alberico Lepore Oct 19 '24 at 18:23

1 Answers1

1

Your observation is essentially the following (where $\,n\ge 1$)

Theorem $ $ If $\,p\,$ is an odd prime and $\,b = 2^{\large p^{2n}-1}\!-1\,$ then $\,p\mid b.\,$ If $\,p^2\mid b\,$ then $\, p^2\mid 2^{\color{#c00}{p-1}}\!-1\,$ i.e. $\,p\,$ is a Wieferich prime. Hence $\,(p^n,b) = p\,$ if $\,p\,$ is not Wieferich.

Proof $\ $ $p\mid 2^{\large p^{2n}-1}-1\,$ by $\,p-1\mid p^{2n}-1\,$ and Fermat's little Theorem.

If $\,p^2\mid b\,$ then $\!\bmod p^2\!:\ 2^{p(p-1)}\!\equiv 1\equiv 2^{\large p^{2n}-1}\!-1\,$ so $\,2^{\:\!\color{#c00}{p-1}}\!\equiv 1,\,$ by $\,\color{#c00}{p\!-\!1} = (p(p\!-\!1), p^{2n}\!-\!1)$

Remark $ $ The proof still works if we replace the power $\,p^{2n}\!-1\,$ by any $\:\!k\,$ with $\,p\!-\!1\mid k,\ p\nmid k$.

Note that there are very fast (essentially linear time) algorithms for testing and decomposing perfect powers - see the paper of Bernstein cited in this answer.

Bill Dubuque
  • 282,220