  We present a quantum version of the classical probabilistic algorithms
$\grave{a}$ la Rabin. The quantum algorithm is based on the essential use of
Grover's operator for the quantum search of a database and of Shor's Fourier
transform for extracting the periodicity of a function, and their combined use
in the counting algorithm originally introduced by Brassard et al. One of the
main features of our quantum probabilistic algorithm is its full unitarity and
reversibility, which would make its use possible as part of larger and more
complicated networks in quantum computers. As an example of this we describe
polynomial time algorithms for studying some important problems in number
theory, such as the test of the primality of an integer, the so called 'prime
number theorem' and Hardy and Littlewood's conjecture about the asymptotic
number of representations of an even integer as a sum of two primes.
