The Universal Euclidean Algorithm: Computing RU Strings and Summation Problems
Introduction
Consider the following geometric problem: mark all vertical lines x = c and horizontal lines y = c where c ∈ ℤ on a plane. Now consider a line y = (px + r)/q where p, r ∈ ℕ and q ∈ ℕ₊. Since the residue class of r modulo q determines the behavior, we can assume r < q without loss of generality.
Imagine a moving point traveling a ...
Posted on Sun, 28 Jun 2026 18:06:32 +0000 by gli
Minimizing Decompositions with Restricted Digits and Monotonic Constraints
A number n can be expressed as the sum of k terms where each term's decimal digits are exclusively 1, 2, or 3. The goal is to find the smallest possible k such a decomposition exists. For T ≤ 1000 test cases and n up to 10^18.
Define a function valid(x, m) that returns true if x can be decomposed into m terms satisfying the digit condition. A f ...
Posted on Fri, 15 May 2026 07:33:23 +0000 by Ace_Online