Numbers & Arithmetic

What a|b Means in Math

In math, a∣ba \mid b means that aa divides bb evenly: there is an integer cc with b=acb = ac. So aa is a factor of bb, and bb is a multiple of aa.

a∣b  ⟺  b=ac for some integer ca \mid b \iff b = ac \text{ for some integer } c

The symbol looks like a fraction bar turned on its side, which causes most of the confusion. It is nothing of the sort. It states a fact about two integers, and the fact is either true or false.

What does a|b mean in math?

The formal definition is one line:

a∣b  ⟺  b=ac for some integer ca \mid b \iff b = ac \text{ for some integer } c

Read aloud, a∣ba \mid b is “a divides b”, “a is a factor of b”, “b is a multiple of a” or “b is divisible by a”. All four say the same thing. For example, 3∣123 \mid 12 is true because 12=3⋅412 = 3 \cdot 4, and 5∤125 \nmid 12 is true because no integer times 55 gives 1212 (5⋅2=105 \cdot 2 = 10 and 5⋅3=155 \cdot 3 = 15). The slashed symbol ∤\nmid means “does not divide”.

The definition is built from multiplication, not division, for a good reason. Whole numbers are not closed under division: the equation 2x=12x = 1 has no integer solution. So mathematicians turned the question around and asked something that always has a yes or no answer: can bb be built by multiplying aa by a whole number? That is the whole idea.

In everyday arithmetic terms, a∣ba \mid b says that dividing bb by aa leaves remainder 00. The definition is more useful than the remainder wording, though, because it lets you work with unknowns, negatives and proofs, as the later sections show.

Quick check

Write 9∣639 \mid 63 as an equation of the form b=acb = ac and name the integer cc.

Is a|b the same as a/b or a divided by b?

No. The expression 18÷618 \div 6 is a number, and its value is 33. The statement 6∣186 \mid 18 is a complete sentence that happens to be true. A quick test: you can attach “is true” or “is false” to a∣ba \mid b, but not to ba\frac{b}{a}. Compare 3∣73 \mid 7, which is false, with 7÷37 \div 3, which is a perfectly good number. For the calculation itself, see dividing integers.

Statement or number?

a∣ba \mid b is true or false, like a=ba = b. The quotient ba\frac{b}{a} is a number. They connect in one way: for a≠0a \neq 0, a∣ba \mid b is true exactly when ba\frac{b}{a} is an integer.

That connection also hands you the integer cc in the definition: c=bac = \frac{b}{a}. The trap that costs points is writing something like 6∣18=36 \mid 18 = 3. The bar never produces an answer. If the quotient is needed, write 18÷6=318 \div 6 = 3 as one statement and 6∣186 \mid 18 as another.

a|b vs b|a: which number goes first?

Order matters. The statement 3∣123 \mid 12 is true, but 12∣312 \mid 3 is false, because 3=12c3 = 12c would force c=14c = \tfrac{1}{4}. A reliable way to remember it: read the bar as “goes into”. Three goes into twelve, so 3∣123 \mid 12.

Try this: Write every positive integer xx for which x∣24x \mid 24 is true, then count them. You should find eight. Now flip each statement to 24∣x24 \mid x and see how many survive (only one).

There is also a size check that needs no arithmetic. If a∣ba \mid b and b≠0b \neq 0, then ∣a∣≤∣b∣|a| \le |b|, because a nonzero multiple of aa is never smaller in size than aa itself. So 20∣1220 \mid 12 is false at a glance. Both directions can be true only when a=±ba = \pm b, such as 5∣−55 \mid -5 and −5∣5-5 \mid 5.

The tables in factors of numbers 1 to 100 show what can stand on the left of the bar for a given bb, and multiples of numbers 1 to 100 shows what can stand on the right for a given aa.

How do you check whether a|b is true?

Wrong versus right divisibility test for 12 using 2 and 6 versus 3 and 4
The number 18 passes the tests for 2 and 6 yet 12 does not divide it, while the coprime pair 3 and 4 exposes this correctly.

There are three dependable methods, and the right one depends on the size of the numbers:

  1. Divide bb by aa and look for remainder 00.
  2. Apply a divisibility rule when aa is small. The divisibility rules cover 22, 33, 44, 55, 66, 99, 1010 and more.
  3. Compare prime factorizations. a∣ba \mid b exactly when every prime in aa appears in bb at least as many times.

One warning about method 2: combine rules only for coprime factors. A number is divisible by 1212 when it passes the tests for 33 and 44, which share no factor. Testing 22 and 66 fails, since 1818 passes both but 12∤1812 \nmid 18.

Worked example 1. Decide whether 14∣39214 \mid 392 and whether 15∣22015 \mid 220.

Using prime factorization, 392=8⋅49392 = 8 \cdot 49, so 392=23⋅72,14=2⋅7.392 = 2^3 \cdot 7^2, \qquad 14 = 2 \cdot 7. Fourteen needs one 22 and one 77, and 392392 has three 22s and two 77s. So 14∣39214 \mid 392. Check: 14⋅28=39214 \cdot 28 = 392.

For the second pair, 220=22⋅5⋅11,15=3⋅5.220 = 2^2 \cdot 5 \cdot 11, \qquad 15 = 3 \cdot 5. There is no factor of 33 in 220220 (its digit sum is 44), so 15∤22015 \nmid 220. Check: 15⋅14=21015 \cdot 14 = 210, leaving remainder 1010.

How does a|b work with negative numbers and zero?

Signs never change the truth of the statement. These three are equivalent: a∣ba \mid b, −a∣b-a \mid b and a∣−ba \mid -b. For example, −4∣20-4 \mid 20 because (−4)(−5)=20(-4)(-5) = 20, using the sign rules in multiplying integers. In practice, strip the signs and test ∣a∣|a| against ∣b∣|b|, the absolute values.

Zero needs separate care. Every integer divides 00, because 0=a⋅00 = a \cdot 0. So 7∣07 \mid 0 and −3∣0-3 \mid 0 are both true, which also means 00 counts as a multiple of everything. The reverse fails: 0∣50 \mid 5 is false, because 0⋅c0 \cdot c is always 00, never 55. This is the one exception to the size rule above, which is why it says b≠0b \neq 0.

The statement 0∣00 \mid 0 depends on convention. With the bare definition it is true, since 0=0⋅c0 = 0 \cdot c for any cc. Many textbooks insist on a≠0a \neq 0 to avoid anything that looks like division by zero, and then it is undefined. Check which version your course uses. Two other fixed facts: 1∣b1 \mid b for every bb, and a∣1a \mid 1 only when a=±1a = \pm 1.

Which rules does a|b always follow?

Five rules cover nearly every proof and puzzle:

  • Transitive: if a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c.
  • Sums and differences: if a∣ba \mid b and a∣ca \mid c, then a∣(b+c)a \mid (b + c) and a∣(b−c)a \mid (b - c).
  • Multiples: if a∣ba \mid b, then a∣bka \mid bk for every integer kk.
  • Products: if a∣ba \mid b and c∣dc \mid d, then ac∣bdac \mid bd.
  • Mutual division: if a∣ba \mid b and b∣ab \mid a, then a=±ba = \pm b.

One clean idea explains the sum rule. If b=apb = ap and c=aqc = aq, then b+c=a(p+q)b + c = a(p + q), so aa factors out. Every rule above is the same move: write the hypotheses as equations, then factor.

Worked example 2. Suppose d∣35d \mid 35 and d∣21d \mid 21. Find every positive dd.

Subtract: d∣(35−21)d \mid (35 - 21), so d∣14d \mid 14. Now d∣21d \mid 21 and d∣14d \mid 14, so d∣(21−14)=7.d \mid (21 - 14) = 7. The positive divisors of 77 are 11 and 77. Check: 7∣357 \mid 35 and 7∣217 \mid 21, and 11 divides everything. So d=1d = 1 or d=7d = 7. This subtract-and-repeat move is the engine behind finding the greatest common factor of large numbers.

Quick check

If 8∣x8 \mid x for some integer xx, must 4∣x4 \mid x also be true?

If a divides bc, must a divide b or c?

Prime factor cards showing 6 divides 4 times 3 but not 4 or 3 alone
Six needs a 2 and a 3, and the 4 and the 3 supply one each, so 6 divides 4 × 3 while dividing neither alone.

Only when aa is prime. For a composite aa, its prime factors can be split between bb and cc. For instance, 6∣4⋅36 \mid 4 \cdot 3 because 4⋅3=124 \cdot 3 = 12, yet 6∤46 \nmid 4 and 6∤36 \nmid 3. The 22 comes from the 44 and the 33 comes from the 33.

For a prime pp, the split is impossible, and this is known as Euclid’s lemma: if p∣bcp \mid bc, then p∣bp \mid b or p∣cp \mid c. Example: 7∣14⋅9=1267 \mid 14 \cdot 9 = 126, and indeed 7∣147 \mid 14. If you need to recall which numbers qualify, the list of prime numbers from 1 to 100 is the reference.

There is a repair for composite aa. If a∣bca \mid bc and aa shares no factor with bb, then a∣ca \mid c. Check it: 6∣5⋅18=906 \mid 5 \cdot 18 = 90, and 66 shares nothing with 55, so 6∣186 \mid 18. Indeed 6⋅3=186 \cdot 3 = 18. Mistakenly “splitting” a product is a common error in proofs, so write out the prime factors of aa before cancelling anything.

How a|b connects to GCD and LCM

Divisibility is the hidden definition behind both. The greatest common divisor of aa and bb is the largest dd with d∣ad \mid a and d∣bd \mid b. The least common multiple is the smallest positive mm with a∣ma \mid m and b∣mb \mid m.

Divides means collapse

For positive integers with a∣ba \mid b, gcd⁡(a,b)=a\gcd(a, b) = a and lcm⁡(a,b)=b\operatorname{lcm}(a, b) = b. Test this first and skip the factor lists.

Take 6∣306 \mid 30. Then gcd⁡(6,30)=6\gcd(6, 30) = 6, since 66 is the biggest number that divides 66 and it also divides 3030. And lcm⁡(6,30)=30\operatorname{lcm}(6, 30) = 30, since 3030 is already a multiple of 66. The page on the least common multiple shows the longer method for pairs where neither number divides the other.

Fractions benefit too. If a∣ba \mid b, then ba\frac{b}{a} is a whole number, so ab\frac{a}{b} reduces to a unit fraction: 630=15\frac{6}{30} = \frac{1}{5}. That is the fastest case in simplifying fractions. In modular arithmetic the same fact is written b≡0(moda)b \equiv 0 \pmod{a}.

Quick check

Given 9∣459 \mid 45, state gcd⁡(9,45)\gcd(9, 45) and lcm⁡(9,45)\operatorname{lcm}(9, 45) without listing factors.

Does a|b ever mean something else in math?

Yes, the vertical bar is overloaded, but context sorts it out. One bar between two integers means “divides”. Bars wrapped around a single quantity mean absolute value. In set-builder and probability notation, a bar reads as “such that” or “given”. In LaTeX, \mid gives correct spacing for the divides sense, and Unicode has dedicated symbols for it: ∣\mid (U+2223) and ∤\nmid (U+2224).

Context Example Reads as
Divisibility 6∣186 \mid 18 6 divides 18
Absolute value ∣−5∣=5\lvert -5 \rvert = 5 absolute value of negative five
Set-builder {x∣x<2}\{x \mid x < 2\} the set of x such that x is less than 2
Conditional probability P(A∣B)P(A \mid B) probability of A given B
Evaluation f(x)∣x=4f(x)\big\vert_{x=4} f of x evaluated at x equals 4

In programming, a | b usually means bitwise OR, not divisibility. In binary, 6=0011026 = 00110_2 and 18=10010218 = 10010_2, so 6 | 18 gives 101102=2210110_2 = 22. The divisibility test in code is a remainder check, such as 18 % 6 == 0.

One last boundary: a∣ba \mid b is defined for integers only. Among rational numbers every nonzero number divides every number, since 5=2⋅2.55 = 2 \cdot 2.5, so the question would carry no information. That is why 2∤52 \nmid 5 is the right statement even though 55 is a perfectly good number in the real number system.

Where a|b shows up in real problems

Anything that must fit evenly is a divisibility question. Packing items into boxes, laying tile along a wall, splitting a schedule into equal shifts, and counting whole weeks in a number of days are all of the form “does aa divide bb?”. Cryptography leans on the same idea: the security of RSA rests on how hard it is to find the primes that divide a very large number.

Worked example 3. A 6060 foot fence needs posts at both ends and equal spacing between them. Which spacings from 4,5,7,8,9,104, 5, 7, 8, 9, 10 feet work, and how many posts does each need?

The spacing ss works exactly when s∣60s \mid 60.

  • s=4s = 4: 60=4⋅1560 = 4 \cdot 15, so it works.
  • s=5s = 5: 60=5⋅1260 = 5 \cdot 12, so it works.
  • s=7s = 7: 60=7⋅8+460 = 7 \cdot 8 + 4, remainder 44, so it fails.
  • s=8s = 8: 60=8⋅7+460 = 8 \cdot 7 + 4, remainder 44, so it fails.
  • s=9s = 9: 60=9⋅6+660 = 9 \cdot 6 + 6, remainder 66, so it fails.
  • s=10s = 10: 60=10⋅660 = 10 \cdot 6, so it works.

The number of posts is 60s+1\frac{60}{s} + 1, because the gaps number 60s\frac{60}{s} and there is one more post than gaps. That gives 1616 posts for 44 feet, 1313 posts for 55 feet and 77 posts for 1010 feet. The failing spacings are exactly the ones that leave a leftover gap shorter than the rest.

Practice problems

0 of 5 solved

  1. True or false: 7∣917 \mid 91.

  2. True or false: −6∣42-6 \mid 42.

  3. Which statement is true: 12∣412 \mid 4 or 4∣124 \mid 12?

  4. List every positive integer dd with d∣18d \mid 18 and d∣24d \mid 24.

  5. Find all positive integers nn such that n∣n+12n \mid n + 12.

Common questions

What does a|b mean in math?

It means a divides b: there is an integer cc with b=acb = ac. Equivalent phrases are that a is a factor of b, and b is a multiple of a. The statement is either true or false, never a number.

Is a|b the same as a divided by b?

No. a∣ba \mid b is a complete true-or-false statement, while b÷ab \div a is a number. The link is that a∣ba \mid b is true exactly when b÷ab \div a is a whole number.

What does the symbol with a slash through the bar mean?

The symbol ∤\nmid means does not divide. For example, 5∤125 \nmid 12 because no integer times 55 equals 1212.

Does 0 divide 0?

Under the bare definition b=acb = ac, yes, since 0=0⋅c0 = 0 \cdot c. Many textbooks require a≠0a \neq 0, which makes 0∣00 \mid 0 undefined. Follow the convention your course uses.

Can a|b be used with negative numbers or fractions?

Negative integers work fine, and signs never change the answer: −4∣20-4 \mid 20 is true. Fractions are not used, because the definition requires integers, otherwise every nonzero number would divide every number.

How is a|b different from |a| and P(A|B)?

A bar between two integers means divides. Bars wrapped around one quantity mean absolute value, and the bar inside P(A∣B)P(A \mid B) means given that. Context tells you which one is meant.

Up next