Bouncy number Created 2026-10-20 Updated 2026-11-05
In decimal representation, a bouncy number is a positive integer whose sequence of numerical digits is neither nondecreasing nor nonincreasing from left to right. Equivalently, one adjacent pair strictly rises and another strictly falls. For example, is bouncy, while and are not. Repeated numerical digits are permitted by the weak order conditions: is nondecreasing.
A number satisfying both weak order conditions has every numerical digit equal, so the overlap consists exactly of the positive repdigits, such as . If count the nondecreasing, nonincreasing and repdigit positive integers at most , respectively, inclusion-exclusion gives the count of bouncy numbers asThis reduces counting the complement of two monotonicity conditions to counting those two simpler families and their explicit overlap.
Past exam of the mathematics course of the University of Cambridge 2010 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-10-14
The Fermat little theorem states that if is a prime number, then for every integer . Equivalently, for , .
To prove it when , multiplication by permutes the nonzero residues . Indeed, implies , and the Euclid lemma implies in this range. Multiplying all these residues givesNone of the factors of is divisible by , so the factorial has a modular inverse. Cancelling it proves , hence . When , the latter identity has both sides zero, completing the proof.
For an odd prime number , the numbers are coprime. The Fermat little theorem gives , and consequentlyThese exponents are distinct, so infinitely many are obtained.
Write the repdigit with copies of asIf , choose to be any positive multiple of . Then has a modular inverse modulo , so . Division by cannot be used modulo ; instead gives , so for every . If , every is divisible by . ThusThe separate treatment of accounts for the prime factor of the geometric-sum denominator.
Repdigit Created 2026-10-14 Updated 2026-10-20
A repdigit is a positive integer whose base- expansion repeats one nonzero digit . For , and , the finite geometric series gives . For example, has decimal digits, all equal to five.
Every prime number not dividing divides infinitely many such repdigits. If it divides , every length works. Otherwise, if it does not divide , the Fermat little theorem gives divisibility for lengths that are multiples of , and division by is justified by its modular inverse. If , the sum is congruent to modulo , so lengths divisible by work instead. A prime dividing but not divides none, since . This distinction prevents invalid cancellation of the geometric-sum denominator.
Repunit Created 2026-10-20 Updated 2026-11-05
In a positional notation of integer radix , a repunit is a repdigit whose numerical digits are all . A length- repunit, with , is the geometric seriesFor example, , while . The same string has different values in different radices.
Appending one numerical digit gives . Thus remainders modulo a positive integer obey , starting with . This recurrence relation avoids constructing huge integers. For decimal repunits modulo , the successive remainders are ; hence the six-digit repunit is divisible by .
A repunit divisible by exists exactly when are coprime integers, and one then exists with at most digits. Necessity follows because a common prime factor of divides every nonconstant term of , leaving remainder one. For sufficiency, examine modulo . If none is zero, the pigeonhole principle gives equal remainders at two indices . Their difference is . Cancelling the invertible factor modulo produces a divisible repunit of length .