Ponder This Challenge - February 2026 - Blot-avoiding backgammon strategy
- Ponder This
A simple primality test is based on Fermat's little theorem: If is prime, . Thus, by choosing a random and computing in that group, one can sometimes detect that is composite when the result is not 1.
However, the test always fails for Carmichael numbers, composite numbers that satisfy for every . The Miller-Rabin primality test addresses this by building on the Fermat test and adding another check during the computation of : square roots of unity. If , then is a square root of unity modulo . For every , we have the trivial roots . Additional roots exist only if is composite.
The smallest Carmichael number is . The largest non-trivial square root of unity modulo 561 is 494.
Your goal: Find a Carmichael number with at least 100 digits and the largest non-trivial square root of unity modulo . 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 with the following property: For every prime divisor of , the digits in the base- representation of sum to (it can be shown that this property implies must be a Carmichael number).
For example, Ramanujan's taxicab number can be written in the following bases:* 5020 in base 7, (5+0+2+0=7)
A simple way to determine if a given number is a Carmichael number is by using Korselt's criterion: is Carmichael if it is square-free and for every prime divisor of , divides . This allows us to easily determine if a number is Carmichael (and primary Carmichael) given its factorization.
A simple method by Chernick to generate Carmichael primes is as follows: if for any we have that are all primes, then their product is Carmichael.
To generate the maximal nontrivial root of unity, one can use the Chinese remainder theorem to compute all roots, since for a prime the roots are then the solution of the system where for every factor , we have that is one of the roots of unity modulo .
A sample solution found in this way:
1296000000000000000000000000002498627160000000000000000000001605745289271600000000000000000343977948543716641
600000000000000000000000000000385591, 1200000000000000000000000000000771181, 1800000000000000000000000000001156771
1296000000000000000000000000002498625000000000000000000000001605742513020600000000000000000343977056463900091