The Agoh–Giuga conjecture is an unsolved problem in number theory concerning the characterization of prime numbers. It states that a positive integer $n$ is prime if and only if the following congruence holds:
$$nB_{n-1} \equiv -1 \pmod{n}$$
where $B_{n-1}$ denotes the $(n-1)$-th Bernoulli number.
Equivalently, the conjecture is often stated in terms of the sum of powers:
$$\sum_{k=1}^{n-1} k^{n-1} \equiv -1 \pmod{n}$$
if and only if $n$ is prime.
The conjecture is named after the Japanese mathematician Takashi Agoh and the Italian mathematician Giuseppe Giuga. Giuga studied the congruence $\sum_{k=1}^{n-1} k^{n-1} \equiv -1 \pmod{n}$ in 1950, defining what are now known as Giuga numbers (composite numbers satisfying this congruence). Agoh independently discovered the equivalent formulation using Bernoulli numbers in 1990.
As of the current state of mathematical knowledge, the conjecture remains unproven. It has been verified computationally for all $n$ up to very large bounds (at least $10^{17}$ or higher depending on the specific verification effort). A composite integer $n$ satisfying the congruence is called a Giuga number; the existence of such numbers would disprove the conjecture, but none have been found. The conjecture is known to be equivalent to several other statements in number theory, including a characterization involving the denominator of Bernoulli numbers.