Problem

Source: Caucasus MO 2024, Seniors P3

Tags: number theory



Let $n$ be a $d$-digit (i.e., having $d$ digits in its decimal representation) positive integer not divisible by $10$. Writing all the digits of $n$ in reverse order, we obtain the number $n'$. Determine if it is possible that the decimal representation of the product $n\cdot n'$ consists of digits $8$ only, if (a) $d = 9998$; (b) $d = 9999?$