Illustration for Sequence Rule Finder
Mathematical Programming & Pattern Detection

Sequence Rule Finder

Mathematical Pattern Detection

Jul 2023 – Aug 2023
4Rule families
nth-termFormulas, predictions and sums

Look Inside

Overview

I independently developed a sequence-analysis program that derives candidate rules from a list of numbers. Instead of merely predicting the next value, it identifies the mathematical structure, derives an nth-term expression and checks whether the rule also explains unused terms.

What It Delivers

  • Detection across polynomial, geometric, mixed and recursive sequence families.
  • Explicit nth-term or recurrence rules instead of unsupported numeric guesses.
  • Sum formulas, predictions and validation checks from the same input.
  • Clear reporting when a finite sequence admits more than one possible explanation.

What I Did

  • Implemented finite-difference tables to detect polynomial sequences and identify their degree.
  • Derived polynomial coefficients by removing highest-degree terms iteratively, using the kth-difference / k! relationship.
  • Added independent cross-checks using simultaneous equations and matrix-based coefficient solving.
  • Extended detection to geometric progressions, exponential-plus-polynomial patterns and second-order linear recurrences.
  • Built rule validation using spare terms, distinguishing supported patterns from plausible but underdetermined fits.
  • Implemented next-term generation, closed-form sums, sequence-membership tests and mathematical verification through induction.
  • Designed rule selection to prefer simpler expressions when multiple candidates fit the observations.

Why It Matters

A mathematical programming project focused on deriving and checking explainable rules, rather than relying on visual pattern matching or next-number guessing.