IBM Research

PUZZLE   IBM-279

Square roots of unity modulo Carmichael numbers

IBM Research · Ponder This · 2021-07

IBM Ponder This #279 · July 2021

A simple primality test is based on Fermat's little theorem: If n is prime, an11(mod n). Thus, by choosing a random aZn and computing an1 in that group, one can sometimes detect that n is composite when the result is not 1.

However, the test always fails for Carmichael numbers, composite numbers that satisfy an11(mod n) for every aZn. The Miller-Rabin primality test addresses this by building on the Fermat test and adding another check during the computation of an1: square roots of unity. If b21(mod n), then b is a square root of unity modulo n. For every n, we have the trivial roots 1,n1. Additional roots exist only if n is composite.

The smallest Carmichael number is 561=31117. The largest non-trivial square root of unity modulo 561 is 494.

Your goal: Find a Carmichael number n with at least 100 digits and the largest non-trivial square root of unity modulo n. Supply your answer in the following format:

n
p1, p2, ..., pn
b

Where n is the Carmichael number, p1, p2, ..., pn are all the prime factors of n, and b is the largest non-trivial square root of unity modulo n.

A bonus "*" will be given for finding a solution that is also a primary Carmichael number:
Primary Carmichael numbers are numbers n with the following property: For every prime divisor p of n, the digits in the base-p representation of n sum to p (it can be shown that this property implies n must be a Carmichael number).

For example, Ramanujan's taxicab number 1729=71319 can be written in the following bases:* 5020 in base 7, (5+0+2+0=7)

  • A30 in base 13, (10+3+0=13)
  • 4F0 in base 19 (4+15+0=19) Thus it is an example of a primary Carmichael number.

Solution

Best opened after a real attempt

To be added.