brain

tamnd's digital brain — notes, problems, research

42752 notes

Appendix J. Historical Notes and Bibliography

Number theory is one of the oldest parts of mathematics, but modern number theory is not a single ancient subject carried forward unchanged. It is a layered discipline....

number-theorybook
Divisor Functions

Divisor functions measure the positive divisors of an integer. They are among the first examples of arithmetic functions, because their values depend directly on the prime...

number-theorybook
Applications to Computation

Modular arithmetic is not only a theoretical language for divisibility. It is also one of the main tools of computation with integers.

number-theorybook
Prime Gaps

Let

number-theorybook
Adelic Methods

Number theory studies arithmetic simultaneously at two levels:

number-theorybook
Higher Reciprocity Laws

Quadratic reciprocity describes when one prime is a square modulo another prime. A natural question is whether similar laws exist for higher powers.

number-theorybook
Hensel’s Lemma

One of the central ideas of number theory is that congruences modulo powers of a prime often approximate genuine arithmetic solutions.

number-theorybook
Fast Modular Exponentiation

Modular arithmetic often requires computing powers such as

number-theorybook
Appendix I. Computational Tools

Computation has become an essential part of number theory. Classical arithmetic relied mainly on symbolic reasoning and hand calculations. Modern arithmetic combines rigorous...

number-theorybook
Short Intervals

The Prime Number Theorem describes the average distribution of primes up to a large number $x$:

number-theorybook
Automorphic Representations

Classically, number theory studied special analytic functions such as modular forms. These functions satisfy strong symmetry conditions under actions of arithmetic groups.

number-theorybook
Completion of Fields

The rational numbers form a field rich enough for arithmetic, yet insufficient for many limiting processes.

number-theorybook
Chinese Remainder Theorem

The Chinese remainder theorem describes when several congruence conditions can be combined into one congruence. Its cleanest form occurs when the moduli are pairwise coprime.

number-theorybook
Error Terms

The Prime Number Theorem states that

number-theorybook
Representation Theory Background

Representation theory studies abstract algebraic objects by expressing them as linear transformations of vector spaces.

number-theorybook
$p$-Adic Numbers

The real numbers arise by completing the rational numbers with respect to the ordinary absolute value. This completion produces a field suited to Euclidean geometry and...

number-theorybook
Gauss Sums

Gauss sums arise from combining multiplicative and additive structures modulo a prime. They form one of the fundamental tools of analytic and algebraic number theory.

number-theorybook
Appendix H. Category Theory Basics

Category theory studies mathematical structures through objects and maps between them. Instead of looking only at what objects are made of, it studies how they relate to other...

number-theorybook
Weil Conjectures

One of the central problems in arithmetic geometry is understanding the number of solutions of polynomial equations over finite fields.

number-theorybook
Absolute Values

The ordinary absolute value on the real numbers measures magnitude:

number-theorybook
Quadratic Reciprocity

The theory of quadratic residues asks a fundamental question:

number-theorybook
Systems of Congruences

A system of congruences asks for an integer satisfying several congruence conditions simultaneously.

number-theorybook
Modular Inverses

In ordinary arithmetic, division by a nonzero number means multiplication by its reciprocal. Modular arithmetic is more delicate. A residue class may or may not have a...

number-theorybook
Linear Congruences

A linear congruence is a congruence of the form

number-theorybook
Arithmetic Modulo $n$

Arithmetic modulo $n$ is arithmetic performed on residue classes modulo $n$. Instead of distinguishing all integers separately, we identify integers that have the same...

number-theorybook
Residue Classes

Congruence modulo $n$ groups integers according to their remainders after division by $n$. If two integers have the same remainder, they are congruent modulo $n$.

number-theorybook
Congruence Relations

Ordinary equality compares integers exactly. In many arithmetic problems, however, only the remainder after division matters.

number-theorybook
Distribution Heuristics of Primes

The infinitude of primes guarantees that primes continue indefinitely, but it says nothing about how frequently primes occur.

number-theorybook
Euler's Proof

Euclid proved that there are infinitely many primes by contradiction. Euler discovered a very different proof based on infinite series and products.

number-theorybook
Euclid's Proof

Euclid's proof of the infinitude of primes is one of the earliest examples of a general argument in number theory. It does not depend on computation, experimentation, or...

number-theorybook
Infinitude of Primes

Prime numbers are the building blocks of the positive integers. Once unique prime factorization is known, a natural question arises: are there only finitely many primes, or do...

number-theorybook
Arithmetic Functions from Factorization

An arithmetic function is a function whose domain is the positive integers. It assigns a value to each integer

number-theorybook
Canonical Prime Decomposition

Unique prime factorization says that every integer $n>1$ can be written as a product of primes. The canonical prime decomposition is the ordered and exponentiated version of...

number-theorybook
Appendix G. Linear Algebra Review

A vector space over a field $F$ is a set $V$ equipped with addition and scalar multiplication satisfying the usual algebraic rules.

number-theorybook
Logarithmic Integral

The logarithmic integral is the function

number-theorybook
Étale Cohomology

Classical topology studies geometric spaces using invariants such as homology and cohomology. Over the complex numbers, algebraic varieties can often be viewed as topological...

number-theorybook
Ramification

One of the central ideas of algebraic number theory is that prime numbers may behave differently after passing to a larger field.

number-theorybook
Appendix F. Measure and Integration

Measure theory extends the ideas of length, area, volume, and integration to more general settings. In number theory, measure appears in probability, harmonic analysis,...

number-theorybook
Prime Number Theorem

The Prime Number Theorem describes the asymptotic distribution of prime numbers. It states that

number-theorybook
Euler Criterion

Euler criterion gives an efficient way to decide whether an integer is a square modulo an odd prime. Let $p$ be an odd prime and let $a$ be an integer not divisible by $p$....

number-theorybook
Arithmetic Surfaces

Arithmetic geometry often studies families of algebraic curves varying over arithmetic bases. The most important base is

number-theorybook
Cyclotomic Fields

One of the most important classes of number fields arises from the solutions of the equation

number-theorybook
Chebyshev Bounds

The prime counting function

number-theorybook
Jacobi Symbol

The Legendre symbol

number-theorybook
Legendre Symbol

Let $p$ be an odd prime and let $a\in\mathbb{Z}$. The Legendre symbol is defined by

number-theorybook
Squares Modulo $n$

A quadratic congruence is a congruence involving a square. The basic form is

number-theorybook
Appendix E. Topology Background

Topology studies continuity, convergence, connectedness, and geometric structure in an abstract setting. In number theory, topology appears naturally in real analysis, complex...

number-theorybook
Curves over Fields

An algebraic curve is a geometric object whose dimension is one. Curves are among the oldest and most important objects in number theory and algebraic geometry.

number-theorybook
Finite Fields

The familiar fields

number-theorybook
Prime Counting Function

One of the oldest questions in number theory asks how prime numbers are distributed among the positive integers. Since primes become less frequent as numbers grow larger,...

number-theorybook
Unique Prime Factorization

The fundamental theorem of arithmetic states that every integer $n>1$ can be written as a product of prime numbers, and that this product is unique up to the order of the factors.

number-theorybook
Geometry of Diophantine Problems

A Diophantine equation is first an arithmetic object. It asks for solutions in integers or rational numbers. But every polynomial equation also defines a geometric object.

number-theorybook
Coprime Integers

Two integers $a$ and $b$, not both zero, are called coprime if their greatest common divisor is $1$:

number-theorybook
Bezout Identities

Let $a$ and $b$ be integers. An integer of the form

number-theorybook
Appendix D. Real and Complex Analysis Review

The real numbers $\mathbb{R}$ extend the rational numbers $\mathbb{Q}$ by filling gaps such as

number-theorybook
Morphisms and Fibers

Geometry is not only concerned with spaces themselves, but also with maps between spaces. In algebraic geometry and arithmetic geometry, these maps are called morphisms.

number-theorybook
Galois Groups

A polynomial equation may possess several roots related by hidden algebraic symmetries. Consider

number-theorybook
Abel Summation

In analytic number theory, one often studies sums of the form

number-theorybook
Rational and Integral Points

A central problem in number theory is to study solutions of polynomial equations whose coordinates belong to a specified number system. Two important cases are:

number-theorybook
Extended Euclidean Algorithm

The Euclidean algorithm computes the greatest common divisor of two integers. The extended Euclidean algorithm does more. It also expresses the gcd as an integer linear...

number-theorybook
Euclidean Algorithm

The greatest common divisor of two integers can be found by listing divisors, but this method becomes inefficient for large numbers. For example, finding

number-theorybook
Exponential Diophantine Equations

An exponential Diophantine equation is a Diophantine equation in which one or more unknowns appear as exponents. Typical examples include

number-theorybook
Catalan-Type Equations

A Catalan-type equation is a Diophantine equation involving powers whose values differ by a small amount. The classical example is

number-theorybook
Least Common Multiples

Let $a$ and $b$ be nonzero integers. An integer $m$ is called a common multiple of $a$ and $b$ if

number-theorybook
Convergence Methods

Analytic number theory studies infinite sums, products, and integrals. Before such expressions can be manipulated safely, one must understand the meaning of convergence.

number-theorybook
Sums of Squares

One of the oldest questions in number theory asks which integers can be written as sums of squares. Typical examples are

number-theorybook
Greatest Common Divisors

Let $a$ and $b$ be integers, not both zero. An integer $d$ is called a common divisor of $a$ and $b$ if

number-theorybook
Appendix C. Abstract Algebra Review

Abstract algebra studies sets equipped with operations. In number theory, these structures organize arithmetic behavior.

number-theorybook
Euler Products

Euler products arise when an infinite series has coefficients controlled by multiplication. The simplest and most important example is the zeta series

number-theorybook
Pell Equations

A Pell equation is a Diophantine equation of the form

number-theorybook
The Division Algorithm

The division algorithm is one of the basic structural facts about the integers. It says that any integer can be divided by a positive integer with a unique quotient and remainder.

number-theorybook
Schemes

Classical algebraic geometry studies varieties defined by polynomial equations. This theory works well over algebraically closed fields, especially over $\mathbb{C}$. However,...

number-theorybook
Splitting Fields

A central problem in algebra is to determine where a polynomial factors completely into linear terms. Consider the polynomial

number-theorybook
Infinite Products

An infinite product has the form

number-theorybook
Pythagorean Triples

A Pythagorean triple is a triple of positive integers

number-theorybook
Composite Numbers

A positive integer $n>1$ is called composite if it is not prime.

number-theorybook
Appendix B. Proof Techniques

A mathematical proof is a logically complete argument establishing the truth of a statement from accepted assumptions, definitions, and previously proved results.

number-theorybook
Prime Numbers

Prime numbers are the fundamental building blocks of arithmetic.

number-theorybook
Appendix

A set is a collection of objects, called its elements. If $x$ is an element of a set $A$, we write $x \in A$. If $x$ is not an element of $A$, we write $x \notin A$.

number-theorybook
LeetCode 925: Long Pressed Name

A clear explanation of the Long Pressed Name problem using a two-pointer scan.

leetcodestringtwo-pointers
LeetCode 975: Odd Even Jump

A clear explanation of counting good starting indices using next-jump preprocessing and dynamic programming.

leetcodearraydynamic-programmingmonotonic-stacksorting
LeetCode 850: Rectangle Area II

A clear explanation of the Rectangle Area II problem using sweep line and merged active y-intervals.

leetcodearrayordered-setsegment-treesweep-line
LeetCode 974: Subarray Sums Divisible by K

A clear explanation of counting subarrays whose sum is divisible by k using prefix sums and remainder frequencies.

leetcodearrayhash-tableprefix-sum
LeetCode 973: K Closest Points to Origin

A clear explanation of returning the k closest points to the origin using squared distance and sorting.

leetcodearraymathsortingheap
LeetCode 849: Maximize Distance to Closest Person

A clear explanation of the Maximize Distance to Closest Person problem using gaps between occupied seats.

leetcodearraytwo-pointersgreedy
LeetCode 848: Shifting Letters

A clear explanation of the Shifting Letters problem using suffix sums and modulo arithmetic.

leetcodearraystringprefix-sumsuffix-sum
LeetCode 972: Equal Rational Numbers

A clear explanation of comparing rational numbers written as decimal strings with optional repeating parts.

leetcodemathstringfractions
LeetCode 847: Shortest Path Visiting All Nodes

A clear explanation of the Shortest Path Visiting All Nodes problem using multi-source BFS and bitmask state compression.

leetcodegraphbreadth-first-searchbitmaskdynamic-programming
LeetCode 924: Minimize Malware Spread

A clear explanation of minimizing malware spread by analyzing connected components with Union Find.

leetcodegraphunion-finddepth-first-searchbreadth-first-search
LeetCode 971: Flip Binary Tree To Match Preorder Traversal

A clear explanation of matching a binary tree preorder traversal by greedily flipping nodes.

leetcodetreebinary-treedepth-first-searchgreedy
LeetCode 846: Hand of Straights

A clear explanation of the Hand of Straights problem using sorting, frequency counting, and greedy grouping.

leetcodearrayhash-tablegreedysorting
LeetCode 923: 3Sum With Multiplicity

A clear explanation of counting index triplets with duplicate values using frequency counts and combinatorics.

leetcodearrayhash-tabletwo-pointerscombinatorics
LeetCode 900: RLE Iterator

A clear explanation of designing an iterator over a run-length encoded sequence without expanding it.

leetcodearraydesigniteratorsimulation
LeetCode 970: Powerful Integers

A clear explanation of generating all powerful integers using bounded powers and a set.

leetcodemathhash-tableenumeration
LeetCode 922: Sort Array By Parity II

A clear explanation of placing even numbers at even indices and odd numbers at odd indices using two pointers.

leetcodearraytwo-pointerssorting
LeetCode 845: Longest Mountain in Array

A clear explanation of the Longest Mountain in Array problem using peak detection and two-pointer expansion.

leetcodearraytwo-pointers
LeetCode 899: Orderly Queue

A clear explanation of finding the lexicographically smallest string after queue operations using rotation and sorting.

leetcodestringmathsorting
LeetCode 969: Pancake Sorting

A clear explanation of sorting an array using prefix reversals by repeatedly placing the largest remaining value.

leetcodearraysortinggreedy
LeetCode 1000: Minimum Cost to Merge Stones

A clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.

leetcodearraydynamic-programminginterval-dpprefix-sum
LeetCode 875: Koko Eating Bananas

A clear explanation of finding the minimum banana-eating speed using binary search on the answer.

leetcodearraybinary-search