There is a paper by V. Drinfeld 1981, which title is "Number of two-dimensional irreducible representations of the fundamental group of a curve over a finite field". It gives a formula for this number in terms of zeta-function of the curve. (See comments below).

**Question** I wonder is there (or may it exist in principle) some arithmetic analog of this result ? I.e. when curve over finite field is substituted by the ring of integers in some number field.

Comments Drinfeld's paper is just 2.5 pages, but it seems it is byproduct of his work on the Langlands conjectures (see e.g. this paper). The pdf in Russian is available for free here. The main theorem is on the first page, you do not need to know Russian to understand formulas, let me just give translation of relevant words.

The curve over F_q is denoted by "X". The number in question is u(X). Theorem says that u(x) = bc, where "b" and "c" are explicitly expressed via zeta-function, genus and "q".

PS

I remember I have seen text by M.Kontsevich where he gave another proof of this result, I cannot find it now, can one suggest a link ?

As far as I understand ideologically if we work with the curve over the complex numbers the analog of this result should tell us about the VOLUME of the moduli space of representations of the fundamental group of the curve - which in turn can be seen as a limit of the celebrated Verlinde formula.

PSPS

See also this MO question: Number of 2-dimensional irreducible representations of a finite group ?