09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

94 INTEGER FUNCTIONS<br />

Also, as we guessed, we can now compute c, because the third column<br />

has become easy to fathom. It contains d copies of the arithmetic progression<br />

O/m, d/m, 2d/m, . , (m - d)/m, so its sum is<br />

d(;(()+!$).$ = F;<br />

the third column is actually subtracted, not added, so we have<br />

d-m<br />

c = -.<br />

2<br />

End of mystery, end of quest. The desired closed <strong>for</strong>m is<br />

where d = gcd(m, n). As a check, we can make sure this works in the special<br />

cases n = 0 and n = 1 that we knew be<strong>for</strong>e: When n = 0 we get d =<br />

gcd(m,O) = m; the last two terms of the <strong>for</strong>mula are zero so the <strong>for</strong>mula<br />

properly gives mLx/ml. And <strong>for</strong> n = 1 we get d = gcd(m, 1) = 1; the last<br />

two terms cancel nicely, and the sum is just 1x1.<br />

By manipulating the closed <strong>for</strong>m a bit, we can actually make it symmetric<br />

in m and n:<br />

x [T/ =d[???+~n+!$-?!<br />

O$k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!