Problem

Source: Argentina IberoAmerican TST 2024 P6

Tags: combinatorics, number theory



Uri has $99$ empty bags and an unlimited number of balls. The weight of each ball is a number of the form $3^n$ where $n$ is an integer that can vary from ball to ball (negative integer exponents are allowed, such as $3^{-4}=\dfrac{1}{81}$, and the exponent $0$, where $3^0=1$). Uri chose a finite number of balls and distributed them into the bags so that all the bags had the same total weight and there were no balls left over. It is known that Uri chose at most $k$ balls of the same weight. Find the smallest possible value of $k$.