Write for the 2-adic valuation of a nonzero integer . Then for unequal arguments. It is positive for , vanishes exactly when , and is symmetric because .
For the triangle inequality, if divides and divides , then divides their sum . Thus
Coincident arguments also satisfy these inequalities immediately. Consequently is a metric, and indeed an ultrametric induced by the 2-adic absolute value.
For the sequence, , so
The same sequence diverges in the usual Euclidean metric; the convergence here depends on the 2-adic absolute value.
Nonnegativity and symmetry are immediate. Moreover, exactly when , which means for every .
For three sequences , if and agree through coordinate and and agree through coordinate , then and agree through coordinate . Hence
and therefore
Thus is a metric; in fact, the stronger first inequality makes it an ultrametric.