ulam

A live working paper · it updates as the agent works

An agent doing number theory

ulam*

Started 14 October 2026

Abstract

ulam reads integer sequences from the On-Line Encyclopedia of Integer Sequences one term at a time. As soon as a rule fits every term it has read, it states the rule as a conjecture and seals it in a hash-chained record. Then it tries to refute the conjecture against every published term it hasn't read, up to a thousand of them. It learns from its own record: rules that held go into a library it tries first, and it asks for more evidence when it has been fooled too often. Its first refutation came from a circle (Figure 2).

Keywords: integer sequences, recurrences, conjectures and refutations, the strong law of small numbers.

    Figure 1. Live: the sequence on the agent's desk right now. Black dots are terms it has read. A sealed conjecture draws hollow rings where it says the next terms will fall; the published terms then land in the rings, or miss in red. Every reader sees the same frame.

    1Introduction

    Figure 2. Six points on a circle, every pair joined: 31 regions, not 32.

    Put points on a circle and join every pair with a chord. One point leaves the circle whole; two cut it in two; then come 4, 8 and 16 regions. Anyone would bet on 32 next. Six points make 31 (Figure 2), and the true rule is a polynomial of degree four.

    Richard Guy called this the strong law of small numbers: there aren't enough small numbers to meet the many demands made of them, so early terms agree with rules they don't follow [2]. Number theory is full of patterns that hold for a while and then stop.

    ulam runs into this law all day. It is an agent that does one thing a mathematician does: look at the start of a sequence, say what the rule is, and then go and find out. It states each conjecture before it sees a single term past the ones it read, and it keeps every refutation on the record.

    2Results

    The table fills in as the agent works.

    Table 1. The latest sequences, newest first. A conjecture that holds agrees with every published term; that is evidence, not proof. † came from its library (Section 3.1).
    SequenceConjectureAfterOutcome

    3What it has learned

    The agent learns from its own record in two ways, and only between sequences, so each sequence is read with one fixed state of mind.

    3.1A library of rules

    Every conjecture that holds is filed in a library. Before it tries any rule of its own, the agent checks the library, most-confirmed rules first, applied exactly as they stand. A library rule has nothing left to fit, so it needs fewer agreeing terms, and how few depends on its track record: five for a rule that has held once, down to three for a rule that has held on three or more sequences, and one more for every time it has fooled the agent. Familiar rules get recognised sooner; unreliable analogies, like taking the partition numbers 1, 1, 2, 3, 5 for Fibonacci's, get trusted less.

    Table 2. The library, most-confirmed rules first. A rule is listed once however many sequences it held on.
    RuleHeld onTerms checked

    3.2How cautious it is

    A conjecture made from a handful of terms is often refuted. The agent keeps count: when more than 45% of its last 20 conjectures were refuted, it asks for one more spare equation before it will conjecture; when fewer than 20% were, it relaxes by one. It waits for eight new conjectures between changes.

    Figure 3. Extra spare equations the agent has wanted before conjecturing, over time. Each step is a change it made after looking at its own refutations.

      4Method

      4.1Choosing and reading

      The agent began with ten well-known sequences. Since then it draws OEIS numbers at random from A000001 to A400800, and anything readers send goes first (Section 5). It skips entries that are the digits of a constant, tables read by rows, finite lists, and entries with fewer than twelve terms. From each entry it keeps only the name, the offset and the listed terms; the formulas, programs and comments people wrote are dropped on arrival, so it never sees them. It reads the terms one at a time.

      4.2Conjectures

      From the fourth term on, after every term it first checks its library (Section 3.1), then tries each kind of rule it knows, simplest first, fitted exactly in rational numbers:

      Rule (3) covers the Catalan and Motzkin numbers, factorials and central binomial coefficients. A rule is accepted only if it fits with equations to spare: at least two more than it has unknowns, more for bigger rules, and more again when the agent has grown cautious (Section 3.2), so it can't simply memorise the terms. The first rule accepted becomes a conjecture.

      4.3Refutation

      The conjecture is sealed in the record together with the terms it came from and its next predictions. Only then does the agent download the b-file, the OEIS's long list of published terms, and compare, up to 1,000 terms. A single miss refutes it. The agent then reads on to the term that refuted it and conjectures again, up to five times per sequence.

      4.4Limits

      “No conjecture” means none of (1)–(3) fits, not that the sequence has no rule: the primes, the partition numbers and most of the OEIS follow rules it can't express. A conjecture that holds agrees with every published term, which is evidence, not a proof. Published terms can contain errors, so a refutation can be the data's fault.

      5Send it a sequence

      Give it an OEIS number and the sequence goes to the front of the queue. Your name goes on its conjectures in the record.

      References

      1. The On-Line Encyclopedia of Integer Sequences, founded by N. J. A. Sloane, oeis.org. Licensed CC BY-SA 4.0.
      2. R. K. Guy. The strong law of small numbers. American Mathematical Monthly 95 (1988), 697–712.
      3. M. Kauers and P. Paule. The Concrete Tetrahedron. Springer, 2011.
      4. K. R. Popper. Conjectures and Refutations. Routledge, 1963.

      Appendix A. The record

      Every conjecture is written down before the agent compares it with a single term it hasn't read, and every outcome after. Each entry carries the hash of the one before it, so nothing can be changed or quietly removed. Checking the chain… The whole chain is at /api/ledger.

      No.Written (UTC)EntrySequenceDetailHash