Ordinary multiplication of natural numbers can be generalized to a ternary operation by considering discrete volumes of lattice hexagons. With this operation, a natural notion of ‘3-primality’ -primality with respect to ternary multiplication- is defined, and it turns out that there are very few 3-primes. They correspond to imaginary quadratic fields Q(√-n), n > 0, with odd discriminant and whose ring of integers admits unique factorization. We also describe how to determine representations of numbers as ternary products and related algorithms for usual primality testing and integer factorization.