MATH-499 · Lesson 12 of 12 · 24 min

Capstone: a model project from question to written thesis

This final lesson assembles the model project into a finished thesis and looks back at how it was made. We follow Amara from her last month of research to submission and the oral examination, and we write the key parts of her thesis in full: the abstract, the plan of the introduction, a new chapter with complete proofs, a chapter of computations and a chapter of further questions. Along the way we collect the practices from the whole course into a checklist that you can apply to your own project.

Where the project stood in February

By February Amara had the results of lesson 6: Theorem 1 characterizing polite numbers, Theorem 2 with its explicit bijection, Corollaries 3 and 4 on the parities and lengths of representations, and Mason's Theorem 5 for sums over all integers. Her literature search had shown that all of these are classical, with the bijective proof best presented in Pong's 2007 article. Her own contributions would therefore have to come from the stretch goals in her proposal. She had worked on three: sums of consecutive odd numbers, the average size of the counting function, and sums of consecutive squares.

The first went well and became a chapter. The second produced a clean asymptotic result with a short proof, which her supervisor encouraged her to include while making clear that LeVeque had studied the counting function far more deeply. The third proved much harder than expected: for consecutive squares the defining equation is quadratic in the starting value, and the clean divisor structure disappears. After three weeks without a general result she followed the advice of lesson 6, recorded her computations and partial observations, and turned them into the further-questions chapter. That decision, made in late February rather than in April, saved the project's schedule.

The abstract

Amara's final abstract, of about 140 words, reads as follows.

Abstract. A representation of a positive integer \(n\) is a sequence of one or more consecutive positive integers with sum \(n\). We give a self-contained account of the classical theorem, due in various forms to Sylvester and Mason, that the number \(r(n)\) of representations equals the number of odd divisors of \(n\), via an explicit bijection with the factorizations of \(2n\) into factors of opposite parity, and we derive from it the possible numbers of terms. We then prove an analogous theorem for sums of consecutive odd integers, show that \(\sum_{n \le x} r(n) = \frac{1}{2}x\ln x + O(x)\), and verify all results computationally for \(n \le 10^6\). Finally we study sums of consecutive squares, for which we present computations, partial results and conjectures.

Observe how much the abstract does. It defines the central object in one sentence, attributes the classical result, says what is new about the presentation, lists the further results precisely, and is honest about the status of the final chapter. A reader who reads nothing else knows exactly what the thesis contains.

The plan of the thesis

The structure of the model thesis, about 36 pages plus references
ChapterContentPages
1 IntroductionThe puzzle; statement of all main results; history from Sylvester (1882) and Mason (1912) to Pong (2007); organization4
2 BackgroundDivisor functions, odd parts, arithmetic progressions, Euler-type counting; notation4
3 Consecutive integersTheorems 1 and 2 with the bijection; parity and length corollaries; Mason's theorem8
4 Consecutive odd integersTheorem 4.1 and its corollaries, with proofs5
5 Average orderProposition 5.1 with proof; numerical comparison3
6 ComputationsAlgorithms, verification to one million, tables and timings5
7 Consecutive squaresComputations, partial results, conjectures4
AppendixPython code and instructions for reproducing every table3

Chapter 4: consecutive odd integers

The chapter on odd integers shows how a thesis turns a worked example into a polished result. In lesson 6 the problem was solved informally. In the thesis it becomes a definition, a theorem with a self-contained statement, a proof with signposts, and corollaries.

Definition 4.1. An odd representation of a positive integer \(n\) is a sequence of one or more consecutive odd positive integers whose sum is \(n\). Let \(s(n)\) denote the number of odd representations of \(n\).

Theorem 4.2. Let \(n\) be a positive integer and let \(\tau\) denote the number-of-divisors function. Then

\[s(n) = \begin{cases} \lceil \tau(n)/2 \rceil & \text{if } n \text{ is odd}, \\ 0 & \text{if } n \equiv 2 \pmod 4, \\ \lceil \tau(n/4)/2 \rceil & \text{if } 4 \mid n. \end{cases}\]

Proof. We first translate odd representations into factorizations. The sum of the \(k\) consecutive odd integers \(2b + 1, 2b + 3, \ldots, 2b + 2k - 1\), where \(b \ge 0\), is

\[\sum_{j=0}^{k-1}(2b + 2j + 1) = k(2b + 1) + k(k - 1) = k(2b + k).\]

Set \(m = 2b + k\). Then \(n = km\) with \(m \ge k\) and \(m \equiv k \pmod 2\). Conversely, if \(n = km\) with \(k \ge 1\), \(m \ge k\) and \(m \equiv k \pmod 2\), then \(b = (m - k)/2\) is a nonnegative integer and the \(k\) consecutive odd integers from \(2b + 1\) sum to \(n\). These two constructions are inverse to each other, so \(s(n)\) equals the number of ordered pairs \((k, m)\) with \(km = n\), \(k \le m\) and \(k \equiv m \pmod 2\).

We count these pairs in three cases. If \(n\) is odd, every divisor of \(n\) is odd, so the parity condition always holds and we must count divisors \(k\) of \(n\) with \(k \le n/k\), that is \(k \le \sqrt{n}\). Divisors come in pairs \(\{k, n/k\}\), which are distinct unless \(k = \sqrt{n}\), so the number of divisors up to \(\sqrt{n}\) is \(\lceil \tau(n)/2 \rceil\). If \(n \equiv 2 \pmod 4\), then in any factorization \(n = km\) exactly one factor is even, since \(n\) has exactly one factor of 2; so no pair has equal parity and \(s(n) = 0\). If \(4 \mid n\), then \(k\) and \(m\) cannot both be odd, so both are even: \(k = 2k'\) and \(m = 2m'\) with \(k'm' = n/4\) and \(k' \le m'\). Conversely every such pair gives a valid \((k, m)\). The number of such pairs is \(\lceil \tau(n/4)/2 \rceil\), by the same counting as in the odd case. \(\blacksquare\)

Corollary 4.3. A positive integer \(n\) is a sum of two or more consecutive odd positive integers if and only if \(n\) is an odd composite number or a multiple of 4.

Proof. For odd \(n\), the representation with \(k = 1\) always exists, so a second one exists exactly when \(\lceil \tau(n)/2 \rceil \ge 2\), that is \(\tau(n) \ge 3\), which means \(n\) is composite. For \(4 \mid n\) the representation with \(k = 1\) does not exist, since \(n\) is even, and \(\lceil \tau(n/4)/2 \rceil \ge 1\), so every representation has at least two terms and at least one exists. For \(n \equiv 2 \pmod 4\) there are none. \(\blacksquare\)

Thus \(4 = 1 + 3\), \(8 = 3 + 5\), \(9 = 1 + 3 + 5\) and \(15 = 3 + 5 + 7\), while 6, 10 and 14 have no odd representations at all. For 15 the theorem predicts \(\lceil \tau(15)/2 \rceil = 2\) odd representations, namely 15 itself and \(3 + 5 + 7\). Checking each theorem against small examples in this way, in the thesis itself, reassures the reader and catches slips before an examiner does.

Chapter 5: the average number of representations

How many representations does a typical integer have? The counts fluctuate wildly, from 1 at powers of two to 96 at 675,675 in the range up to a million, so the natural question concerns the average.

Proposition 5.1. For real \(x \ge 1\),

\[\sum_{n \le x} r(n) = \frac{1}{2}x\ln x + O(x).\]

Proof. By Theorem 2, \(r(n)\) is the number of odd divisors of \(n\). Interchanging the order of counting,

\[\sum_{n \le x} r(n) = \sum_{n \le x}\ \sum_{d \mid n,\ d \text{ odd}} 1 = \sum_{d \le x,\ d \text{ odd}} \Big\lfloor \frac{x}{d} \Big\rfloor,\]

since the odd number \(d\) divides exactly \(\lfloor x/d \rfloor\) integers \(n \le x\). Writing \(\lfloor x/d \rfloor = x/d - \theta_d\) with \(0 \le \theta_d < 1\), the error terms contribute at most the number of odd \(d \le x\), which is at most \(x\). It remains to estimate the sum of \(1/d\) over odd \(d \le x\). With \(H(y) = \sum_{j \le y} 1/j\), the odd terms are the full sum minus the even terms:

\[\sum_{d \le x,\ d \text{ odd}} \frac{1}{d} = H(x) - \frac{1}{2}H\Big(\frac{x}{2}\Big).\]

Since \(H(y) = \ln y + O(1)\) for \(y \ge 1\), a standard comparison of the sum with \(\int_1^y dt/t\), this equals \(\ln x - \frac{1}{2}\ln x + O(1) = \frac{1}{2}\ln x + O(1)\) for \(x \ge 2\); for \(1 \le x < 2\) both sides are bounded. Multiplying by \(x\) and adding the error \(O(x)\) gives the result. \(\blacksquare\)

A sharper result follows from a classical theorem that the thesis can cite rather than prove. Dirichlet showed in 1849 that the divisor summatory function \(D(x) = \sum_{n \le x}\tau(n) = \sum_{d \le x}\lfloor x/d \rfloor\) satisfies \(D(x) = x\ln x + (2\gamma - 1)x + O(\sqrt{x})\), where \(\gamma \approx 0.5772\) is Euler's constant. The even values \(d = 2e\) contribute \(\sum_{e \le x/2}\lfloor (x/2)/e \rfloor = D(x/2)\), so the sum over odd \(d\) is \(D(x) - D(x/2)\), and therefore

\[\sum_{n \le x} r(n) = \frac{1}{2}x\ln x + \Big(\gamma - \frac{1}{2} + \frac{\ln 2}{2}\Big)x + O(\sqrt{x}),\]

with constant \(\gamma - \frac{1}{2} + \frac{1}{2}\ln 2 \approx 0.4238\). Amara presents this as Proposition 5.2, with Dirichlet's theorem cited, and points to LeVeque's paper for finer results. The thesis is clear about which steps are proved in it and which rest on a cited theorem.

Comparing the sum of r(n) with its main term and estimating the next-order constant
from math import log

N = 10 ** 6
odd_div = [0] * (N + 1)
for d in range(1, N + 1, 2):
    for m in range(d, N + 1, d):
        odd_div[m] += 1

total, checkpoints = 0, {10 ** k for k in range(2, 7)}
print("       x    sum r(n)    x ln(x)/2   (sum - x ln(x)/2)/x")
for n in range(1, N + 1):
    total += odd_div[n]
    if n in checkpoints:
        main = n * log(n) / 2
        print(f"{n:8d} {total:11d} {main:12.0f}   {(total - main) / n:8.4f}")
Output
       x    sum r(n)    x ln(x)/2   (sum - x ln(x)/2)/x
     100         275          230     0.4474
    1000        3879         3454     0.4251
   10000       50292        46052     0.4240
  100000      618025       575646     0.4238
 1000000     7331585      6907755     0.4238

The last column approaches 0.4238 as \(x\) grows, as Proposition 5.2 predicts, with the deviation shrinking roughly like \(1/\sqrt{x}\). Agreement between a cited theorem and an independent computation is exactly the kind of cross-check that lesson 7 recommends, and it would expose a misremembered constant at once.

Chapter 7: consecutive squares

For sums of consecutive squares, the count \(q(n)\) of representations of \(n\) as a sum of one or more consecutive positive squares behaves very differently. The program below computes it and lists the integers with many representations.

Representations as sums of consecutive squares: rare, and rarely more than one
from math import isqrt

N = 200000
q = [0] * (N + 1)
for a in range(1, isqrt(N) + 1):
    s = 0
    for b in range(a, isqrt(N) + 1):
        s += b * b
        if s > N:
            break
        q[s] += 1

multi = [n for n in range(1, N + 1) if q[n] >= 2]
print("n up to", N, "with at least one representation:", sum(1 for n in range(1, N + 1) if q[n]))
print("with two or more:", len(multi), "- the first ten:", multi[:10])
top = max(q)
print("maximum number of representations:", top, "attained at", [n for n in range(1, N + 1) if q[n] == top])
# examples
for n in multi[:3]:
    reps = []
    for a in range(1, isqrt(n) + 1):
        s, b = 0, a
        while s < n:
            s += b * b
            b += 1
        if s == n:
            reps.append(f"{a}^2..{b - 1}^2")
    print(n, "=", ", ".join(reps))
Output
n up to 200000 with at least one representation: 5491
with two or more: 135 - the first ten: [25, 365, 841, 1405, 1730, 2030, 3281, 3655, 3740, 4510]
maximum number of representations: 3 attained at [20449, 147441]
25 = 3^2..4^2, 5^2..5^2
365 = 10^2..12^2, 13^2..14^2
841 = 20^2..21^2, 29^2..29^2

Representations as sums of consecutive squares are sparse, since the number of sums of two or more consecutive squares up to \(x\) is only of the order of \(x^{2/3}\), and multiple representations are rare. Classical facts appear, such as \(25 = 3^2 + 4^2 = 5^2\), the pleasant \(365 = 10^2 + 11^2 + 12^2 = 13^2 + 14^2\), and the curiosity that \(1^2 + 2^2 + \cdots + 24^2 = 70^2\), a problem posed by Édouard Lucas in 1875 and settled by G. N. Watson in 1918, who proved that 24 is the only nontrivial number of initial squares summing to a square. Amara's chapter presents her computations, proves the elementary facts she could, such as the reduction for two terms to the equation \(2n - 1 = (2a + 1)^2\), and states two conjectures supported by data, clearly labelled as such. Examiners regard such a chapter highly when it is honest and well organized.

Final checks before submission

The last weeks are for checking, and the checking should be systematic. Amara's checklist, which summarizes the practices of this course, is worth adopting.

A pre-submission checklist
AreaCheck
StatementsEvery theorem self-contained; hypotheses stated; examples showing why each is needed
ProofsEvery step justified; every clearly checked; proofs reread a week after writing
ComputationsEvery number in the text regenerated by the appendix scripts; independent checks recorded
ReferencesEvery citation checked against the source; entries exported from databases; nothing uncited
AttributionKnown results credited at point of use; new results identified as such
LaTeXNo undefined references or citations in the log; consistent notation; figures referred to
ReadingWhole thesis read aloud once; read by a fellow student; supervisor comments addressed
IntegrityUse of software and AI tools disclosed according to policy; all code credited

The computational check deserves automation. Amara kept a single script that recomputes every number quoted in the thesis and asserts that it matches. Running it before submission takes seconds and guarantees that no table has drifted out of date as the code evolved.

A reproducibility script asserting every number quoted in the thesis
from math import comb

def r(n):
    c, k = 0, 1
    while k * (k + 1) // 2 <= n:
        c += (n - k * (k - 1) // 2) % k == 0
        k += 1
    return c

def tau(n):
    return sum(1 for d in range(1, n + 1) if n % d == 0)

def s_odd(n):          # Theorem 4.2
    if n % 2:
        return -(-tau(n) // 2)
    if n % 4 == 2:
        return 0
    return -(-tau(n // 4) // 2)

def s_direct(n):
    c = 0
    for start in range(1, n + 1, 2):
        t, x = 0, start
        while t < n:
            t, x = t + x, x + 2
        c += t == n
    return c

claims = {
    'r(15) = 4':                         r(15) == 4,
    'r(45) = 6':                         r(45) == 6,
    'powers of 2 have r = 1':            all(r(2 ** e) == 1 for e in range(12)),
    'Theorem 4.2 for n <= 500':          all(s_odd(n) == s_direct(n) for n in range(1, 501)),
    '15 has 2 odd representations':      s_direct(15) == 2,
    'circle regions for 6 points = 31':  comb(6, 4) + comb(6, 2) + 1 == 31,
    '1^2 + ... + 24^2 = 70^2':           sum(k * k for k in range(1, 25)) == 70 ** 2,
}
for claim, ok in claims.items():
    print(("ok   " if ok else "FAIL ") + claim)
print("all claims verified" if all(claims.values()) else "some claims FAILED")
Output
ok   r(15) = 4
ok   r(45) = 6
ok   powers of 2 have r = 1
ok   Theorem 4.2 for n <= 500
ok   15 has 2 odd representations
ok   circle regions for 6 points = 31
ok   1^2 + ... + 24^2 = 70^2
all claims verified

The oral examination

Amara's examiners asked her to run the bijection for \(n = 45\) at the board, to explain why the starting term is positive, and what changes for sums over all integers. The second examiner asked about the connection with partitions: Sylvester's paper relates partitions into distinct parts to partitions into odd parts, and representations as consecutive sums are the partitions into distinct parts whose parts form an interval. She had read that section of Sylvester's paper in a second pass, and could sketch the connection. Finally they asked what she would do with another year. She proposed studying representations by consecutive terms of other arithmetic progressions, where the linear structure survives, before returning to squares, where it does not. The examiners' report praised the clarity of the exposition, the careful separation of classical and new material, and the honest treatment of the squares chapter.

A table listing the six odd divisors of 45, namely 1, 3, 5, 9, 15 and 45, with the number of terms and the corresponding representation: 45; 14 + 15 + 16; 7 + 8 + 9 + 10 + 11; 1 + 2 + ... + 9; 5 + 6 + ... + 10; and 22 + 23.
The bijection for \(n = 45\), as Amara wrote it on the board: each odd divisor gives one representation

Looking back

The model project followed the arc of this course. A question arose from curiosity and was made precise (lesson 1). It was sized with a ladder of goals and planned on a timeline (lesson 2). Reading and searching revealed that the main result was classical, with a literature that supplied a proof and pointed to open variations (lessons 3 and 4). Experiments generated conjectures and exposed false patterns (lesson 5). Special cases led to theorems and theorems to generalizations (lesson 6). Computation verified everything and suggested what could not yet be proved (lesson 7). A proof assistant could certify the core (lesson 8). Writing, typesetting and presenting turned the mathematics into a thesis and a talk (lessons 9 to 11).

Your own project will differ in every detail, but the practices transfer. And an honours project need not be an ending. Strong projects become talks at undergraduate conferences, papers in journals that publish undergraduate research, such as Involve or the SIAM Undergraduate Research Online, contributions to mathlib or the OEIS, and the foundation of applications to graduate school or to research positions. Above all, the project is your first experience of mathematics as it is actually made: uncertain, collaborative, often frustrating and, when a proof finally works, deeply satisfying.

Common mistakes

  • MistakeContinuing to pursue a stuck stretch goal until the deadline.

    InsteadDecide early to convert it into documented computations, partial results and conjectures.

  • MistakeAn abstract that describes the thesis vaguely.

    InsteadState the objects, the results and the status of each part precisely.

  • MistakeAsserting a refined result from memory, such as a constant, without proof or citation.

    InsteadState only what is proved or properly cited; estimate other quantities empirically and say so.

  • MistakeTables that no longer match the final code.

    InsteadKeep a reproducibility script that recomputes and asserts every quoted number.

  • MistakeTreating the oral examination as a formality.

    InsteadPrepare examples, limitations, connections to the literature and ideas for further work.

Summary and key terms

  • A finished thesis combines classical results presented with care, the student's own results, computations and honest further questions.
  • The abstract states precisely what is proved, what is classical and what remains conjectural.
  • Chapter 4 proves a complete theorem for sums of consecutive odd integers via factorizations \(n = km\) with \(k \le m\) of equal parity.
  • Proposition 5.1: \(\sum_{n \le x} r(n) = \frac{1}{2}x\ln x + O(x)\), proved by interchanging the order of counting.
  • Sums of consecutive squares are sparse and lack the divisor structure; a well-organized chapter of computations and conjectures is valuable.
  • A pre-submission checklist and a reproducibility script make the thesis reliable; the oral examination rewards preparation and honesty.
odd representation
A sequence of one or more consecutive odd positive integers with a given sum.
average order
The asymptotic behaviour of the average of an arithmetic function.
big O notation
f(x) = O(g(x)) means |f(x)| is at most a constant times g(x) for large x.
reproducibility script
A program that recomputes and checks every numerical claim in a document.
stretch goal
An ambitious version of the project question pursued if time allows.
further questions
The closing part of a thesis presenting open problems, partial results and conjectures.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Use Theorem 4.2 to compute \(s(36)\) and list the odd representations of 36.

    Show answer

    \(4 \mid 36\), \(n/4 = 9\), \(\tau(9) = 3\), so \(s(36) = 2\). Pairs \((k', m') = (1, 9), (3, 3)\) give \((k, m) = (2, 18), (6, 6)\): \(17 + 19\) and \(1 + 3 + 5 + 7 + 9 + 11\).

  2. Why is \(s(n) = 0\) when \(n \equiv 2 \pmod 4\)?

    Show answer

    In any factorization \(n = km\), exactly one factor is even, so \(k\) and \(m\) have different parities, but an odd representation requires equal parity.

  3. In the proof of Proposition 5.1, why do the floor errors contribute \(O(x)\)?

    Show answer

    Each error \(\theta_d\) lies in \([0, 1)\), and there are at most \(x\) odd \(d \le x\), so their total is less than \(x\).

  4. Show that \(n\) is a sum of two consecutive squares if and only if \(2n - 1\) is the square of an odd number greater than 1.

    Show answer

    \(a^2 + (a + 1)^2 = 2a^2 + 2a + 1\), so \(2n - 1 = 4a^2 + 4a + 1 = (2a + 1)^2\) with \(a \ge 1\); conversely solve for \(a\).

  5. Write a one-sentence statement of the status of the consecutive-squares chapter suitable for the introduction.

    Show answer

    For example: Chapter 7 studies sums of consecutive squares, for which the divisor structure of the earlier chapters is absent; we present computations up to 200,000, elementary results for two and three terms, and two conjectures.

  6. Add a claim to the reproducibility script checking Proposition 5.1's main term at \(x = 10^4\) within 10 parts in 100. What is the claim?

    Show answer

    For example: abs(sum(r(n) for n in range(1, 10 ** 4 + 1)) - 10 ** 4 * log(10 ** 4) / 2) / (10 ** 4 * log(10 ** 4) / 2) less than 0.1, which holds since the next term is of order x.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz