# Anomalous cancellation

An anomalous cancellation or accidental cancellation is a particular kind of arithmetic procedural error that gives a numerically correct answer. An attempt is made to reduce a fraction by cancelling individual digits in the numerator and denominator. This is not a legitimate operation, and does not in general give a correct answer, but in some rare cases the result is numerically the same as if a correct procedure had been applied.[1] The trivial cases of cancelling trailing zeros or where all of the digits are equal is ignored.

Examples of anomalous cancellations which still produce the correct result include (these and their inverses are all the cases in base 10 with the fraction different from 1 and with two digits):

• ${\displaystyle {\frac {64}{16}}={\frac {\not 64}{1\!\!{\not 6}}}={\frac {4}{1}}=4}$
• ${\displaystyle {\frac {26}{65}}={\frac {2\!\!{\not 6}}{\not 65}}={\frac {2}{5}}}$
• ${\displaystyle {\frac {19}{95}}={\frac {1\!\!{\not 9}}{\not 95}}={\frac {1}{5}}}$
• ${\displaystyle {\frac {98}{49}}={\frac {\not 98}{4\!\!{\not 9}}}={\frac {8}{4}}=2.}$[2]

The article by Boas analyzes two-digit cases in bases other than base 10, e.g., 32/13 = 2/1 and its inverse are the only solutions in base 4 with two digits.[2]

The anomalous cancellation happens also with more digits, e.g. 165/462 = 15/42.

## Elementary properties

When the base is prime no solutions exist. This can be proved by contradiction: suppose a solution exists, and without loss of generality we can say that this solution is

${\displaystyle {\frac {a||b}{c||a}}={\frac {b}{c}}}$

where the line indicates digit concatenation. Thus we have

${\displaystyle {\frac {ap+b}{cp+a}}={\frac {b}{c}}\implies (a-b)cp=b(a-c)}$

But ${\displaystyle p>a,b,a-c}$ as they are digits in base ${\displaystyle p}$ yet ${\displaystyle p|b(a-c)}$ which means that ${\displaystyle a=c}$ so therefore the right hand side is zero which means the left hand side must also be zero, i.e ${\displaystyle a=b}$, a contradiction.

Another property is that the numbers of solutions in a base ${\displaystyle n}$ is odd if and only if ${\displaystyle n}$ is an even square. This can be proved similarly to the above: suppose that we have a solution

${\displaystyle {\frac {a||b}{c||a}}={\frac {b}{c}}}$

Then doing the same manipulation we get

${\displaystyle {\frac {an+b}{cn+a}}={\frac {b}{c}}\implies (a-b)cn=b(a-c)}$

Suppose that ${\displaystyle a>b,c}$. Then note that ${\displaystyle a,b,c\to a,a-c,a-b}$ is also a solution to the equation. This almost sets up a involution from the set of solutions to itself, but a problem arises when ${\displaystyle b=a-c,c=a-b}$. In this case, we can substitute in to get ${\displaystyle (a-b)^{2}n=b^{2}}$ so this only has solutions when ${\displaystyle n}$ is a square. Let ${\displaystyle n=k^{2}}$. Square rooting and rearranging yields ${\displaystyle ak=(k+1)b}$. Since the greatest common divisor of ${\displaystyle k,(k+1)}$ is one, we know that ${\displaystyle a=(k+1)x,b=kx}$. Noting that ${\displaystyle a,b, this has precisely the solutions ${\displaystyle x=1,2,3,\ldots ,k-1}$ i.e it has an odd number of solutions when ${\displaystyle n=k^{2}}$ is an even square. The converse of the statement may be proved my noting that these solutions all satisfy the initial requirements.

## References

1. ^ Weisstein, Eric W. "Anomalous Cancellation". MathWorld.
2. ^ a b Boas, R. P. "Anomalous Cancellation." Ch. 6 in Mathematical Plums (Ed. R. Honsberger). Washington, DC: Math. Assoc. Amer., pp. 113–129, 1979.