Example 29 (2003 National High School Mathematics Competition Question) Let the three sides of a triangle be integers $l, m, n$, and $l>m>n$. It is known that $\left\{\frac{3^{l}}{10^{4}}\right\}=\left\{\frac{3^{m}}{10^{4}}\right\}=\left\{\frac{3^{n}}{10^{4}}\right\}$, where $\{x\}=x-[x]$, and $[x]$ represents the greatest integer not exceeding $x$. Find the minimum perimeter of such a triangle.
From the given, we know
$$
\frac{3^{l}}{10^{4}}-\left[\frac{3^{l}}{10^{4}}\right]=\frac{3^{m}}{10^{4}}-\left[\frac{3^{m}}{10^{4}}\right]=\frac{3^{n}}{10^{4}}-\left[\frac{3^{n}}{10^{4}}\right] .
$$

Thus, $3^{l} \equiv 3^{m} \equiv 3^{n}\left(\bmod 10^{4}\right)$
$$
\Leftrightarrow\left\{\begin{array}{l}
3^{l} \equiv 3^{m} \equiv 3^{n}\left(\bmod 2^{4}\right) \\
3^{l} \equiv 3^{m} \equiv 3^{n}\left(\bmod 5^{4}\right) .
\end{array}\right.
$$

Since $(3,2)=1$, it follows from (1) that
$3^{l-n} \equiv 3^{m-n} \equiv 1\left(\bmod 2^{4}\right)$.
Let $u$ be the smallest positive integer satisfying $3^{u} \equiv 1\left(\bmod 2^{4}\right)$, then for any positive integer $v$ satisfying $3^{v} \equiv 1\left(\bmod 2^{4}\right)$, we have $u \mid v$, i.e., $u$ divides $v$. In fact, if $u \times v$, then by the division algorithm, there exist non-negative integers $a$ and $b$, such that $v=a u+b$, where $0 < b < u$. If $b \neq 0$, then $3^{b} \equiv 1\left(\bmod 2^{4}\right)$, contradicting the minimality of $u$. Therefore, $b=0$, and $u \mid v$.

Since $r>s$, the sides of the triangle are $500 r+n, 500 s+n$, and $n$, and we have $n>500(r-s)$. Therefore, when $s=1, r=2, n=501$, the perimeter of the triangle is minimized, with a value of
$(1000+501)+(500+501)+501=3003$.
Note: A key to solving this problem is to find the smallest integer satisfying the congruence $3^{\prime \prime} \equiv 1\left(\bmod 10^{4}\right)$. This number is defined in number theory as the order (or exponent) of 3 modulo $10^{4}$.