MathDB
Romania NMO 2023 Grade 5 P2

Source: Romania National Olympiad 2023

April 14, 2023
algebrasum of digits

Problem Statement

We say that a natural number is called special if all of its digits are non-zero and any two adjacent digits in its decimal representation are consecutive (not necessarily in ascending order).
a) Determine the largest special number mm whose sum of digits is equal to 20232023.
b) Determine the smallest special number nn whose sum of digits is equal to 20222022.