Computation Workshop Solution Checker

Fractions Subtracted Incorrectly

Here is an example of some fractions substracted incorrectly, yet somehow still arrives at the right answer:

\(\frac{8}{2} - \frac{9}{3} = \frac{8 \; - \; 9}{2 \; - \; 3} = \frac{-1}{-1} = 1.\)

We are interested in finding more examples of when this happens. In particular we are looking for positive integers \(a,b,c,d\) such that \(\frac{a}{b} - \frac{c}{d} = \frac{a-c}{b-d}\). For any fixed integer \(c\) let \(S(c)\) denote the sum of all possible values for \(a\). For example if \(c=9\) then the only possiblities for \(a\) are \(5\) and \(8\) (although there are infinitely many possibilities for \(b\) and \(d\)), and so \(S(9) = 5 + 8 = 13\).

\( \frac{5}{1} - \frac{9}{3} = \frac{5 - 9}{1 - 3}, \;\;\;\; \frac{8}{2} - \frac{9}{3} = \frac{8 - 9}{2 - 3}, \;\;\;\; \frac{8}{4} - \frac{9}{3} = \frac{8 - 9}{4 - 6}, \;\;\;\; \frac{5}{2} - \frac{9}{6} = \frac{8 - 9}{2 - 6}, \ldots\)

Part A Find \(S(90)\)
Part B Find \(S(9000)\)
Part C Find \(S(12!)\)

A Spirals Diagonals

Let \(n\) be a positive integer. The numbers from \(1\) to \(n^2\) are arranged into an \(n \times n\) grid in a spiral pattern, starting from the top-left corner. Let \(D(n)\) denote the sum of the diagonals of this grid.

Example: If \(n=3\) then the grid is

123
894
765

And so \(D(3) = 1+3+5+7+9 = 25\).

Another Example: If \(n=4\) then the grid is

1234
1213145
1116156
10987

And so \(D(4) = 1+4+7+10+13+14+15+16 = 80\).

Part A Find \(D(12)\)
Part B Find \(D(12345)\)
Part C Find \(D(123456)\)