A book has n consecutive pages torn out. Suppose A is the last numbered page before the torn-out section and B is the first numbered page following the torn out section. Find a formula for n in terms of A and B.