Balanced number Created 2026-10-20 Updated 2026-11-05
A balanced number is a positive integer whose first decimal digits have the same digit sum as its last decimal digits, where is the number of numerical digits. For odd , the middle numerical digit appears on both sides and cancels, so only the equally long outer halves need to be compared.
For example, is balanced because . It is not a palindromic number: equality of two digit sums does not require reversed digits. At odd length, is balanced because the outer pairs and both sum to three; its middle digit is irrelevant to the equality.
Digit dynamic programming can tabulate counts and value sums of fixed-length halves indexed by digit sum, then match equal indices. The first half must begin with a nonzero numerical digit, while the last half may contain initial zeros, as in . Preserving the half length is essential when assembling the positional value.
Binary-coded decimal 2026-10-31
Represent a decimal number by coding each decimal digit separately as four bits of weights . The codes 10–15 are unused for one digit; a Boolean circuit must specify whether these combinations produce a defined result or are don't-care conditions.
For a nonnegative integer with decimal expansion , the congruence gives whenever . Thus divisibility by three or nine is equivalent to divisibility of the sum of its decimal digits by the same number. More generally a base- expansion has the analogous rule for every divisor of . This follows by repeated addition and multiplication in modular arithmetic; it does not require an empirical rule about decimal notation.
Decimal expansion Created 2026-10-14 Updated 2026-11-05
A decimal expansion writes a nonnegative real number using decimal digits at successive powers of ten:
Nonnegative indices describe the integer part, and negative indices describe the fractional part. For a negative real number, add a minus sign to the expansion of its positive magnitude. A terminating decimal has a zero tail; a general decimal expansion can require infinitely many fractional digits.
An infinite tail of nines can duplicate a terminating expansion. For example, the geometric series gives . The usual uniqueness convention excludes a final infinite tail of nines, and redundant leading zeros are ignored.
For a nonnegative integer , only finitely many nonnegative powers are needed: . This makes divisibility tests into polynomial calculations modulo the proposed divisor. Since ,
Thus is divisible by exactly when its alternating digit sum is divisible by . That sum need not be literally zero: for , it is , and .
Pandigital prime Created 2026-10-20 Updated 2026-11-05
A pandigital prime is a prime number that is also a pandigital number for a specified radix, digit alphabet and repetition convention. For example, uses each of exactly once and is prime; trial division by prime numbers at most its square root verifies the latter condition.
The digit sum supplies a useful obstruction. A decimal number using exactly once has digit sum . If this sum is divisible by and the number exceeds , the number is composite. In particular, a number using all ten decimal digits exactly once has digit sum and cannot be prime. The filter follows from the digit sum integer congruence, independently of the order in which the digits occur.
Step number Created 2026-10-20 Updated 2026-11-05
A step number is a positive integer whose adjacent decimal digits differ by exactly . For example, and are step numbers, while is not: its first two numerical digits have difference zero. Repetition is allowed; only neighboring differences are constrained.
The numerical digits form a walk on the path graph , starting at a nonzero digit. From a last digit , the possible extensions are within the range . At endpoints there is only one extension.
For digit dynamic programming, record the last digit and a bit mask encoding the set of digits already visited. Appending updates the visited set by set union with . Here pandigital means that every decimal digit appears at least once; repetitions are allowed. Accept only final states whose visited set contains all ten numerical digits. This separates local adjacency from the global requirement to have seen every digit.