Difference between revisions of "2019 OIM Problems/Problem 1"
(Created page with "== Problem == For each positive integer <math>n</math>, let <math>s(n)</math> be the sum of the squares of the digits of <math>n</math>. For example, <math>s(15) = 1^2 + 5^2 =...") |
|||
Line 5: | Line 5: | ||
== Solution == | == Solution == | ||
− | {{solution | + | Notice that if <math>n</math> has <math>d</math> digits, then <math>s(n)\le81d</math> (by setting <math>n=\overline{999\dots999}</math>). Using this, we can easily show that the only possible values of <math>d</math> are <math>d=1,2,3</math> since any greater would cause <math>81d<10^d</math>, so the maximum value of <math>s(n)</math> will always be less than the least possible value of <math>n</math>; thus <math>s(n)\ne n</math>.\\ |
+ | |||
+ | Thus, we attempt casework on <math>d</math>. The case <math>d=1</math> is trivial; only <math>n=1</math> is a solution. Next, for <math>d=2</math>, we can show that the tens digit must always be even by considering parity of the ones digit versus parity of <math>s(n)</math>. Then, we can perform casework on the tens digit, which results in no solutions for this case. | ||
+ | |||
+ | Finally, we consider <math>d=3</math>. The maximum of <math>s(n)</math> here is <math>9^2\cdot3=243</math>, so we can divide our work down. If the hundreds digit is <math>2</math>, then the maximum becomes <math>2^2+9^2+9^2=166<200</math>, so the hundreds digit must be <math>1</math>. Then we can perform casework on ones digit parity to show that the tens digit is always odd. Furthermore, the maximum in this case is <math>1^2+9^2+9^2=163</math>, so we only need to test the tens digit equal to <math>1,3,5</math>. These efforts result in no solutions, so <math>\boxed{n=1}</math> is the only solution, which clearly works. | ||
+ | |||
+ | ~ [https://artofproblemsolving.com/wiki/index.php/User:Eevee9406 eevee9406] | ||
== See also == | == See also == | ||
[[OIM Problems and Solutions]] | [[OIM Problems and Solutions]] |
Latest revision as of 23:17, 19 March 2025
Problem
For each positive integer , let
be the sum of the squares of the digits of
. For example,
. Find all integers
such that
.
~translated into English by Tomas Diaz. ~orders@tomasdiaz.com
Solution
Notice that if has
digits, then
(by setting
). Using this, we can easily show that the only possible values of
are
since any greater would cause
, so the maximum value of
will always be less than the least possible value of
; thus
.\\
Thus, we attempt casework on . The case
is trivial; only
is a solution. Next, for
, we can show that the tens digit must always be even by considering parity of the ones digit versus parity of
. Then, we can perform casework on the tens digit, which results in no solutions for this case.
Finally, we consider . The maximum of
here is
, so we can divide our work down. If the hundreds digit is
, then the maximum becomes
, so the hundreds digit must be
. Then we can perform casework on ones digit parity to show that the tens digit is always odd. Furthermore, the maximum in this case is
, so we only need to test the tens digit equal to
. These efforts result in no solutions, so
is the only solution, which clearly works.