Maths WorkshopMaths problems with full solutions

Congruences

54 problems · Modular arithmetic, linear congruences, Chinese Remainder Theorem and Fermat's Little Theorem.

Ex.223Arithmetic modulo $n$
#modular arithmetic #operations #compatibility
Congruences
High school
High school
Ex.224Congruence as an equivalence relation
#equivalence relation #congruence #residue classes
Congruences
High school
High school
Ex.317A large power modulo 7
#congruences #periodicity
Congruences
High school
High school
Ex.338Sums of two squares modulo 4
#congruences #squares
Congruences
L1
L1
Ex.342The last digit of 7^2026
#congruences #periodicity
Congruences
High school
High school
Ex.434A linear congruence
#linear congruence #inverse #solution
Congruences
High school
High school
Ex.618n + S(n) + S(S(n)) = 60
#digit sum #congruence modulo 9 #bounding
Congruences
M1
M1
Ex.6198k + 7 is not a sum of three squares
#squares modulo 8 #representation by squares
Congruences
Olympiad
Olympiad
Ex.750An incompatible congruence system
#Chinese remainder #compatibility condition
Congruences
L1
L1
Ex.841Coprimality via congruences
#coprime #congruence #linear combination
Congruences
L1
L1
Ex.842A CRT application
#CRT #application #calendar
Congruences
L1
L1
Ex.843The Chinese remainder theorem (two moduli)
#Chinese remainder theorem #CRT #coprime moduli
Congruences
L1
L1
Ex.844Euler's theorem
#Euler theorem #totient #modular exponentiation
Congruences
L1
L1
Ex.845Computing $\varphi(n)$
#Euler totient #computation #prime factorization
Congruences
L1
L1
Ex.846Generalization of Fermat
#Fermat #generalization #coprime
Congruences
L1
L1
Ex.847Fermat's little theorem
#Fermat #prime #modular exponentiation
Congruences
L1
L1
Ex.848Halving in modular arithmetic
#halving #modular arithmetic #odd modulus
Congruences
L1
L1
Ex.849Finding modular inverses
#modular inverse #extended Euclidean #algorithm
Congruences
L1
L1
Ex.850Inverse via Fermat
#Fermat #inverse #modular arithmetic
Congruences
L1
L1
Ex.851Solvability of $ax\equiv b\pmod n$
#linear congruence #gcd criterion #number of solutions
Congruences
L1
L1
Ex.852Applications of the modular inverse
#modular inverse #application #linear congruence
Congruences
L1
L1
Ex.853Power cycles modulo $n$
#power cycle #periodicity #modulus
Congruences
L1
L1
Ex.854A system of congruences
#system #CRT #linear congruences
Congruences
L1
L1
Ex.855The order of an element mod $n$
#order #multiplicative group #divisor
Congruences
L1
L1
Ex.856Computing large powers mod $n$
#modular exponentiation #square-and-multiply #fast power
Congruences
L1
L1
Ex.1328A multiple of n written with only 0s and 1s
#pigeonhole #repunits #decimal digits
Congruences
M1
M1
Ex.1330If aᵖ ≡ bᵖ (mod p) then aᵖ ≡ bᵖ (mod p²)
#Fermat's little theorem #binomial theorem #lifting
Congruences
Olympiad
Olympiad
Ex.1334Counting odd entries in a row of Pascal's triangle
#binomial coefficients #parity #binary expansion #generating function
Congruences
Olympiad
Olympiad
Ex.1337((p − 1)/2)! modulo a prime p ≡ 3 (mod 4)
#Wilson's theorem #factorials modulo p #quadratic residues
Congruences
Olympiad
Olympiad
Ex.1339The sum of the quadratic residues modulo p
#quadratic residues #sum of squares #divisibility
Congruences
Olympiad
Olympiad
Ex.1483A Chinese remainder system
#Chinese remainder theorem #congruences #Bézout
Congruences
L1
L1
Ex.1578CRT with non-coprime moduli
#CRT #non-coprime #compatibility
Congruences
L1
L1
Ex.1579The CRT as a ring isomorphism
#CRT #ring isomorphism #product
Congruences
L1
L1
Ex.1580The CRT with three moduli
#CRT #three moduli #pairwise coprime
Congruences
L1
L1
Ex.1581The Diffie–Hellman protocol
#Diffie-Hellman #cryptography #modular
Congruences
L1
L1
Ex.1582Euler's theorem applied
#Euler theorem #totient #computation
Congruences
L1
L1
Ex.1583Fermat's little theorem and pseudoprimes
#Fermat #pseudoprime #compositeness
Congruences
L1
L1
Ex.1584Proving Fermat's little theorem
#Fermat #proof #permutation
Congruences
L1
L1
Ex.1585Legendre symbol and Euler's criterion
#Legendre symbol #Euler criterion #quadratic reciprocity
Congruences
Olympiad
Olympiad
Ex.1586RSA and modular arithmetic
#RSA #cryptography #modular exponentiation
Congruences
L1
L1
Ex.1587Primitive roots
#primitive root #generator #cyclic group
Congruences
Olympiad
Olympiad
Ex.1588Quadratic residues mod $p$
#quadratic residues #Legendre symbol #Euler criterion
Congruences
L1
L1
Ex.1589A system of linear congruences
#system #linear congruences #CRT
Congruences
L1
L1
Ex.1590Wilson's theorem
#Wilson theorem #prime #factorial
Congruences
Olympiad
Olympiad
Ex.1996Every prime ≡ 1 (mod 4) is a sum of two squares
#sum of two squares #Thue's lemma #pigeonhole #Wilson
Congruences
Olympiad
Olympiad
Ex.1997n divides φ(aⁿ − 1)
#order #Euler's theorem #totient
Congruences
Olympiad
Olympiad
Ex.2108A Carmichael number check
#Carmichael #Fermat #pseudoprime
Congruences
Olympiad
Olympiad
Ex.2109The Carmichael function $\lambda(n)$
#Carmichael function #lcm #exponent
Congruences
M1
M1
Ex.2110The discrete logarithm
#discrete logarithm #cyclic group #Pohlig-Hellman
Congruences
Olympiad
Olympiad
Ex.2111Power tower modulo $n$
#power tower #modular exponentiation #Carmichael
Congruences
Olympiad
Olympiad
Ex.2112Square roots modulo $p$
#square roots #mod p #Tonelli-Shanks
Congruences
Olympiad
Olympiad
Ex.2113Stirling numbers via modular arithmetic
#Stirling #modular arithmetic #combinatorics
Congruences
M1
M1
Ex.2114NTT and modular arithmetic (statement)
#NTT #number theory transform #FFT #modular
Congruences
M1
M1
Ex.2240Primitive roots exist modulo every prime
#primitive root #order #totient #polynomial roots
Congruences
Olympiad
Olympiad