18
$\begingroup$

Let $n=pq$ with $p,q$ odd primes $p

If we only know $n$ but not $p$ and $q$, is there a fast way to determine if $p-1|q-1$ without factorizing $n$ ?

  • 2
    I suppose that there exists an algorithm that factors $n$ relatively fast if it is known that $p-1\mid q-1$. The failure of this fast factorization would then indicate that $p-1\nmid q-1$2017-01-09
  • 2
    If $p = 3$, then it doesn't matter what $q$ is. At least this should help round up a few small concrete examples, enough to do a search in the OEIS.2017-01-09
  • 4
    Found it: http://oeis.org/A177516 Unfortunately, it doesn't give too much information other than the first fifty such $n$ and how to make Mathematica give you a listing.2017-01-09
  • 1
    My hunch: if $\sqrt n$ is slightly more than an integer rather than slightly less. I think it is also important to look at $n$ modulo 4.2017-01-10
  • 0
    The square root thing is not so useful as the squares thin out. The primes thin out, too, of course. The mod $4$ thing might be much more productive, no pun intended.2017-01-10
  • 0
    It's not really a "fast way" but as $p-1|n-1$, factoring $n-1$ can lead to the answer2017-01-12
  • 0
    Actually the "n"-s are forming sequence defined in https://oeis.org/A108574 if this is helpful.2017-01-17

1 Answers 1

14

Let $n = pq$

if $p-1 \mid q-1$

1: $p-1 \mid n-1$

2: $q-1 \not\mid n-1$ (if this false, $n$ is a Carmichael number with 2 divisors)

3: $x^{n-1} = 1 \pmod p$ for any $x$ where $x$ is coprime with $n$ $\implies$ $x^n = x \pmod p$

So, we can do this steps:

Get random $x$ from $[0, n-1]$

Calculate $t = (x^n-x) \bmod n$. It is not $0$ with the probability about $\frac{\phi(q-1)}{q-1}$

$t=0 \pmod p$. So, greatest common divisor of $n$ and $t$ is $p$ if $p-1 \mid q-1$

So, if $\gcd \{\,n,t\,\}$ is $1$ - we can say "no".

if $\gcd \{\,n, t\,\} > 1$, we get the factorization and can check $p-1 \mid q-1$ manually

  • 1
    I don't get why "$x^{n-1} = 1$ (mod p) for any x where x is coprime with n", I guess it have something to do with a generalisation of Fermat Little theorem but can't figure how2017-01-13
  • 1
    n-1 = t(p-1), so is a Fermat Little thm2017-01-13