Determine the number of positive integers $n \leq 1000$ such that the sum of the digits of $5n$ and the sum of the digits of $n$ are the same.
Problem
Source:
Tags: number theory, digit sum
27.04.2015 01:16
well $9, 99, 999$ all work. not sure about others though
27.04.2015 01:18
Note that we need $n=5n$ mod $9$, which implies $n$ is a multiple of $9$. The first several values all work.
27.04.2015 01:26
Why mod 9 though.
27.04.2015 01:28
Because if $s(n)$ denotes the sum of the digits of a number, we always have $s(n)=n$ mod $9$.
30.04.2015 18:19
Okay so by Octophi's argument we know that $n=9k$ and so we are searching for $k \le 111$ such that $s(9k)=s(45k)$. Clearly $k=111$ is a solution since we have $s(9k)=s(999)=27=s(4995)=s(45k)$. For $k<111$ clearly $s(9k) \le 18$ so we are searching for $k$ such that either $s(9k)=s(45k)=9$ or that $s(9k)=s(45k)=18$. Take some $k \le 111$. Then clearly $k'=111-k$ satisfies $s(9k')=s(999-9k)=27-s(9k)$. Also $s(45k')=s(4995-45k)=27-s(45k)$. So, if $k$ is a solution with $s(9k)=s(45k)=9$ then $k'=111-k$ is a solution for $s(9k')=s(45k')=18$ and vice versa. So, it is sufficient to count the numbers $k<111$ such that $s(9k)=s(45k)=9$. But by some calculations and ugly casework we get that this yields 45 solutions for $k$ and so in total we have $2 \cdot 45+1=91$ solutions.