  We give a new characterization of the set $\mathcal{C}$ of Carmichael numbers
in the context of $p$-adic theory, independently of the classical results of
Korselt and Carmichael. The characterization originates from a surprising link
to the denominators of the Bernoulli polynomials via the sum-of-base-$p$-digits
function. More precisely, we show that such a denominator obeys a
triple-product identity, where one factor is connected with a $p$-adically
defined subset $\mathcal{S}$ of the squarefree integers that contains
$\mathcal{C}$. This leads to the definition of a new subset $\mathcal{C}'$ of
$\mathcal{C}$, called the "primary Carmichael numbers". Subsequently, we
establish that every Carmichael number equals an explicitly determined
polygonal number. Finally, the set $\mathcal{S}$ is covered by modular subsets
$\mathcal{S}_d$ ($d \geq 1$) that are related to the Kn\"odel numbers, where
$\mathcal{C} = \mathcal{S}_1$ is a special case.
