Donald Knuth recommends using the symbol ⊥ between two numbers to indicate that they are relatively prime. For example:
The symbol is denoted
perp in TeX because it is used in geometry to denote perpendicular lines. It corresponds to Unicode character U+27C2.
I mentioned this on TeXtip yesterday and someone asked for the reason for the symbol. I’ll quote Knuth’s original announcement and explain why I believe he chose that symbol.
When gcd(m, n) = 1, the integers m and n have no prime factors in common and we way that they’re relatively prime.
This concept is so important in practice, we ought to have a special notation for it; but alas, number theorists haven’t agreed on a very good one yet. Therefore we cry: Hear us, O Mathematicians of the World! Let us not wait any longer! We can make many formulas clearer by adopting a new notation now! Let us agree to write ‘m ⊥ n ’, and to say “m is prime to n,” if m and n are relatively prime.
This comes from Concrete Mathematics. In the second edition, the text is on page 115. The book explains why some notation is needed, but it does not explain why this particular symbol.
[Correction: The book does explain the motivation for the symbol. The justification is in a marginal note and I simply overlooked it. The note says "Like perpendicular lines don't have a common direction, perpendicular numbers don't have common factors."]
Here’s what I believe is the reason for the symbol.
Suppose m and n are two positive integers with no factors in common. Now pick numbers at random between 1 and mn. The probability of being divisible by m and n is 1/mn, the product of the probabilities of being divisible by m and n. This says that being divisible by m and being divisible by n are independent events. Also, independent events are analogous to perpendicular lines. The analogy is made precise in this post where I show the connection between correlation and the law of cosines.
So in summary, the ideas of being relatively prime, independent, and perpendicular are all related, and so it makes sense to use a common symbol to denote each.
Four uncommon but handy math notations
Connecting number theory and probability