brain
tamnd's digital brain — notes, problems, research
43815 notes
Measure theory extends the ideas of length, area, volume, and integration to more general settings. In number theory, measure appears in probability, harmonic analysis,...
The Prime Number Theorem describes the asymptotic distribution of prime numbers. It states that
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$....
Arithmetic geometry often studies families of algebraic curves varying over arithmetic bases. The most important base is
One of the most important classes of number fields arises from the solutions of the equation
The prime counting function
The Legendre symbol
Let $p$ be an odd prime and let $a\in\mathbb{Z}$. The Legendre symbol is defined by
A quadratic congruence is a congruence involving a square. The basic form is
Topology studies continuity, convergence, connectedness, and geometric structure in an abstract setting. In number theory, topology appears naturally in real analysis, complex...
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.
The familiar fields
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,...
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.
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.
Two integers $a$ and $b$, not both zero, are called coprime if their greatest common divisor is $1$:
Let $a$ and $b$ be integers. An integer of the form
The real numbers $\mathbb{R}$ extend the rational numbers $\mathbb{Q}$ by filling gaps such as
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.
A polynomial equation may possess several roots related by hidden algebraic symmetries. Consider
In analytic number theory, one often studies sums of the form
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:
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...
The greatest common divisor of two integers can be found by listing divisors, but this method becomes inefficient for large numbers. For example, finding
An exponential Diophantine equation is a Diophantine equation in which one or more unknowns appear as exponents. Typical examples include
A Catalan-type equation is a Diophantine equation involving powers whose values differ by a small amount. The classical example is
Let $a$ and $b$ be nonzero integers. An integer $m$ is called a common multiple of $a$ and $b$ if
Analytic number theory studies infinite sums, products, and integrals. Before such expressions can be manipulated safely, one must understand the meaning of convergence.
One of the oldest questions in number theory asks which integers can be written as sums of squares. Typical examples are
Let $a$ and $b$ be integers, not both zero. An integer $d$ is called a common divisor of $a$ and $b$ if
Abstract algebra studies sets equipped with operations. In number theory, these structures organize arithmetic behavior.
Euler products arise when an infinite series has coefficients controlled by multiplication. The simplest and most important example is the zeta series
A Pell equation is a Diophantine equation of the form
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.
Classical algebraic geometry studies varieties defined by polynomial equations. This theory works well over algebraically closed fields, especially over $\mathbb{C}$. However,...
A central problem in algebra is to determine where a polynomial factors completely into linear terms. Consider the polynomial
An infinite product has the form
A Pythagorean triple is a triple of positive integers
A positive integer $n>1$ is called composite if it is not prime.
A mathematical proof is a logically complete argument establishing the truth of a statement from accepted assumptions, definitions, and previously proved results.
Prime numbers are the fundamental building blocks of arithmetic.
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$.
A clear explanation of the Long Pressed Name problem using a two-pointer scan.
A clear explanation of counting good starting indices using next-jump preprocessing and dynamic programming.
A clear explanation of the Rectangle Area II problem using sweep line and merged active y-intervals.
A clear explanation of counting subarrays whose sum is divisible by k using prefix sums and remainder frequencies.
A clear explanation of returning the k closest points to the origin using squared distance and sorting.
A clear explanation of the Maximize Distance to Closest Person problem using gaps between occupied seats.
A clear explanation of the Shifting Letters problem using suffix sums and modulo arithmetic.
A clear explanation of comparing rational numbers written as decimal strings with optional repeating parts.
A clear explanation of the Shortest Path Visiting All Nodes problem using multi-source BFS and bitmask state compression.
A clear explanation of minimizing malware spread by analyzing connected components with Union Find.
A clear explanation of matching a binary tree preorder traversal by greedily flipping nodes.
A clear explanation of the Hand of Straights problem using sorting, frequency counting, and greedy grouping.
A clear explanation of counting index triplets with duplicate values using frequency counts and combinatorics.
A clear explanation of designing an iterator over a run-length encoded sequence without expanding it.
A clear explanation of generating all powerful integers using bounded powers and a set.
A clear explanation of placing even numbers at even indices and odd numbers at odd indices using two pointers.
A clear explanation of the Longest Mountain in Array problem using peak detection and two-pointer expansion.
A clear explanation of finding the lexicographically smallest string after queue operations using rotation and sorting.
A clear explanation of sorting an array using prefix reversals by repeatedly placing the largest remaining value.
A clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.
A clear explanation of finding the minimum banana-eating speed using binary search on the answer.
A clear explanation of making a parentheses string valid using greedy counting.
A clear explanation of the Backspace String Compare problem using stack simulation and an O(1) space two-pointer scan.
A clear explanation of solving Reveal Cards In Increasing Order using sorting and queue simulation over indices.
A counting solution for computing how many directed friend requests are allowed by age rules.
A clear explanation of counting distinct bitwise OR results from all non-empty subarrays using rolling sets.
A clear explanation of counting how many pawns a rook can capture by scanning four directions on a chessboard.
A clear explanation of placing the minimum number of cameras in a binary tree using postorder DFS.
A clear explanation of simulating robot movement on an infinite grid using direction vectors and obstacle lookup.
A clear explanation of solving Largest Time for Given Digits by checking all permutations of four digits.
A clear explanation of the Guess the Word interactive problem using candidate filtering and minimax-style guessing.
A clear explanation of counting valid music playlists using dynamic programming over playlist length and unique songs used.
A string simulation solution for converting each word in a sentence into Goat Latin.
A clear explanation of generating all n-digit numbers whose adjacent digits differ by k.
A clear explanation of inserting a value into a maximum binary tree by following the right spine.
A clear explanation of finding the longest Fibonacci-like subsequence using dynamic programming and value-to-index lookup.
A clear explanation of the Split Array into Fibonacci Sequence problem using backtracking, leading-zero checks, and 32-bit integer limits.
A clear explanation of maintaining a complete binary tree inserter using level-order indexing.
A dynamic programming solution for counting binary trees where every non-leaf node is the product of its children.
A clear explanation of solving Bag of Tokens using sorting, greedy choices, and two pointers.
A clear explanation of rearranging a binary search tree into an increasing right-only tree using inorder traversal.
A clear explanation of implementing a spellchecker with exact, case-insensitive, and vowel-error matching.
A clear explanation of identifying the town judge using trust indegree and outdegree counts.
A clear explanation of finding the maximum circular subarray sum using Kadane's algorithm.
A clear explanation of the Keys and Rooms problem using graph traversal from room 0.
A clear explanation of comparing two binary trees by collecting their leaf value sequences with DFS.
A hash set solution for finding the smallest number that can be hidden from all front-facing cards.
A clear explanation of solving Most Stones Removed with Same Row or Column using connected components and union-find.
A clear explanation of checking whether an array is monotonic using one pass and direction flags.
A clear explanation of checking whether every node in a binary tree has the same value.
A clear explanation of reversing only English letters while keeping all non-letter characters fixed.
A clear explanation of counting unique permutations where every adjacent pair sums to a perfect square using backtracking.
A clear explanation of the Magic Squares In Grid problem using fixed-size subgrid validation.
A two-pass solution for computing the shortest distance from each index to the nearest occurrence of a target character.
A clear explanation of minimizing refueling stops using a greedy max heap over reachable stations.
A clear explanation of expressing a target using the fewest operators with repeated uses of x.
A clear explanation of solving Validate Stack Sequences by simulating stack push and pop operations.
A clear explanation of designing a stack that pops the most frequent value, breaking ties by most recent insertion.