Consider all three-digit numbers that are 543 more than the sum of the squares of their digits. What is the sum of these numbers?
Details and assumptions :
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Nicely done!
How did you come to the conclusion that − 2 5 ≤ b ( b − 1 0 ) ≤ 0 and that 0 ≤ c ( c − 1 ) ≤ 7 2 ?
Log in to reply
2 b + ( 1 0 − b ) 5 b ( 1 0 − b ) b ( b − 1 0 ) b b − 1 0 b ( b − 1 0 ) c c − 1 c ( c − 1 ) ≥ b ( 1 0 − b ) (by AM-GM) ≥ b ( 1 0 − b ) ≤ 2 5 ≥ − 2 5 ≤ 9 ≤ − 1 ≤ 0 ≤ 9 ≤ 8 ≤ 9 ⋅ 8 = 7 2
Does that clear things up? :)
Consider functions like x(x-10)[for 'b'] and x(x-1)[for 'c'], as they are upward parabolas, it becomes easier to find the maximum and minimum on a given interval, especially when we are considering only integers. Fine enough?
very nice resolution,good job
Typo. !! 2 626
The same logic! In my case, I created a nice table of a ( 1 0 0 − a ) b ( 1 0 − b ) and c ( 1 − c ) , and the rest was just to compare the values, even though some of them was pretty obvious. So happy that I answer a level 4 number theory questions, and when I saw that the average time to answer it was more then 1 hour... best feeling ever, orgasmic!!!
Umm, shouldn't it be − 2 5 \leb ( b − 1 0 ) ≤ − 9
Absolutely superb I got stuck in the method how to find a complete set of such numbers.
##python 2.7
for abc in range(100,999):
abc2=abc
a=abc/100
abc = abc - 100*a
b = abc/10
abc = abc -10*b
c = abc
if abc2-(a*a +b*b +c*c)==543:
print abc2
Log in to reply
here's my python
n=100
sum=0
while n <= 999:
a = n % 10
b = (n / 10) % 10
c = (n / 100) % 10
abc_square_sum = (a**2) + (b**2) + (c**2)
if n - abc_square_sum == 543:
sum = sum + n
n=n+1
print "Answer is",sum % 1000
Log in to reply
for x in range(1,10):
for y in range(0,10):
for z in range(0,10):
a = 100*x+10*y+z-x**2-y**2-z**2
if a == 543:
print(x,y,z)
is mine; I printed the numbers separately so I could check them.
Log in to reply
@William Cui – damn! I'm going to assume this works. Can you explain your logic?
In my case I tried to translate the description of the problem as much as I could into code so it would be readable.
t I suppose that this is how you see each digit (of the 3) moving independently, very clever. This way you don't need to extract the digits (if you don't know about the modulus operator)
I also did the same way in C!!!
if 999 had been part of the sum, your algorithm wouldn't have worked, since range returns numbers between [a,b), in your code it's not performing the test against 999, only until 998.
Also your output doesn't give the final answer, just the numbers found.
Please read mine. I think I have a much simpler way of finding the digits using modular calculations.
Learn to use the % operators (Modulus), it will help you a lot as a programmer.
Let a b c denote such three-digit number, where a , b , c ∈ { 0 , 1 , … , 9 } and a = 0 . The required condition is 1 0 0 a + 1 0 b + c = a b c = 5 4 3 + a 2 + b 2 + c 2 . ( ∗ ) Since 1 ≤ a 2 + b 2 + c 2 ≤ 9 2 + 9 2 + 9 2 = 2 4 3 , it follows that 5 ≤ a ≤ 7 . Consider 3 cases:
case 1 : If a = 5 , then condition ( ∗ ) becomes ( 1 0 b − b 2 ) + c ( 1 − c ) = 6 8 . Since 1 0 b − b 2 ≤ 4 ( − 1 ) 4 ( − 1 ) ( 0 ) − 1 0 0 = 2 5 and c ( 1 − c ) ≤ 0 , it follows that this equation has no solution. Hence a = 5 .
case 2 : If a = 6 , then condition ( ∗ ) becomes b 2 − 1 0 b + ( c 2 − c − 2 1 ) = 0 . This is a quadratic equation in b with an integer solution, namely b , so the discriminant must be a perfect square. That is 1 0 0 − 4 ( c 2 − c − 2 1 ) = 4 ( 4 6 − ( c − 1 ) c ) is a perfect square. Since 4 is a perfect square, we have 4 6 − ( c − 1 ) c is a perfect square. It can be easily checked that this occurs when c = 6 or c = 7 . Consider the following subcases:
case 2.1 : If c = 6 , then by the quadratic formula, we have b = 2 1 0 ± 4 ( 4 6 − ( c − 1 ) c ) = 2 1 0 ± 2 ( 4 ) = 1 , 9 . So for this case we have a b c = 6 1 6 or 6 9 6 .
case 2.2 : If c = 7 , then by the quadratic formula, we have b = 2 1 0 ± 4 ( 4 6 − ( c − 1 ) c ) = 2 1 0 ± 2 ( 2 ) = 3 , 7 . So for this case we have a b c = 6 3 7 or 6 7 7 .
case 3 : If a = 7 , then condition ( ∗ ) becomes b 2 − 1 0 b + ( c 2 − c − 1 0 8 ) = 0 . This is a quadratic equation in b with an integer solution, namely b , so the discriminant must be a perfect square. That is 1 0 0 − 4 ( c 2 − c − 1 0 8 ) = 4 ( 1 3 3 − ( c − 1 ) c ) is a perfect square. Since 4 is a perfect square, we have 1 3 3 − ( c − 1 ) c is a perfect square. It can be easily checked that this occurs when c = 4 . By the quadratic formula, we have b = 2 1 0 ± 4 ( 1 3 3 − ( c − 1 ) c ) = 2 1 0 ± 2 ( 1 1 ) = − 6 , 1 6 , a contradiction to the assumption that b is a single digit. Hence a = 7 .
It can be easily checked that the numbers 6 1 6 , 6 9 6 , 6 3 7 and 6 7 7 satisfy the condition of the question. Their sum is 6 1 6 + 6 9 6 + 6 3 7 + 6 7 7 = 2 6 2 6 , having 6 2 6 as the last three digits.
Nicely done! See the comments for some more details.
Sorry, what do you mean "This is a quadratic equation in b with an integer solution, namely b, so the discriminant must be a perfect square." ?
Log in to reply
If we rewrite the equation in variable x , then the equation will be of the form x 2 − 1 0 x + ( c 2 − c − 2 1 ) = 0 , where c 2 − c − 2 1 is a constant. Then this becomes a quadratic equation with x = b as a solution.
The problem initially states "Consider all three-digit numbers". Why did you exclude a=0 in your answer?
Log in to reply
If a = 0 , then we would have a two-digit number. For example, the number 034 is equal to 34.
Log in to reply
Wouldn't a better rational be that there are no two-digit numbers that are greater than the sum of the squares of their digits by exactly 543? I.e. the smallest sum of squares is 1 and the biggest two-digit number (99) is less than 544.
In case 1, how did come up with 10b−b^2 ≤ (4(−1)(0)−100)/(4(−1))?
why 10b-b² < 4(-1(0)-100/(4(-1) ?
Log in to reply
A fact from analytic geometry states:
The vertex (turning point) of a parabola y = a x 2 + b x + c is at ( − b / 2 a , ( 4 a c − b 2 ) / 4 a ) .
This means the extremum of the function f ( x ) = a x 2 + b x + c is ( 4 a c − b 2 ) / 4 a .
In this case the function is f ( x ) = 1 0 x − x 2 whose graph is concave down (leading coefficient is negative), so it reaches the maximum value at its vertex and that value (according to the above formula) is ( 4 ( − 1 ) ( 0 ) − 1 0 2 ) / 4 ( − 1 ) = 2 5 .
Can you expand on your statement: it follows that 5≤a≤7?
Log in to reply
From 1 ≤ a 2 + b 2 + c 2 ≤ 2 4 3 , we have 5 4 6 ≤ a b c ≤ 7 8 6 and since a is the first digit, it follows that 5 ≤ a ≤ 7 .
Log in to reply
Did you mean 544 instead of 546? Thanks for filling in the missing step.
Log in to reply
@Clay Young – Yes, sorry for the misprint.
In case 2, you state that 100−4(c2−c−21)=4(46−(c−1)c). Where did 4(46−(c−1)c come from?
Log in to reply
Factoring out the 4 from the expression, we get 1 0 0 − 4 ( c 2 − c − 2 1 ) = 4 ( 2 5 − ( c 2 − c − 2 1 ) ) = 4 ( 2 5 − c 2 + c + 2 1 ) = 4 ( 4 6 − c ( c − 1 ) ) .
Any 3 digit number may be expressed in the form 1 0 0 a + 1 0 b + c where a is the hundreds digit, b is the tens digit and c is the units digit. We can then apply this to give the equation 1 0 0 a + 1 0 b + c − 5 4 3 = a 2 + b 2 + c 2 . Rearranging and completing the square gives: ( a − 5 0 ) 2 + ( b − 5 ) 2 + ( c − 0 . 5 ) 2 = 1 9 8 2 . 2 5 .
Claim: a = 6
Proof:
If a ≤ 5 , ( a − 5 0 ) 2 ≥ 2 0 2 5 ∴ ( b − 5 ) 2 + ( c − 0 . 5 ) 2 ≤ − 4 2 . 7 5 , but the sum of squares of real numbers can't be negative, we've reached a contradiction, so a ≥ 6 .
The maximum value of ( b − 5 ) 2 is 1 6 (when b = 1 or b = 9 ), the maximum value of ( c − 0 . 5 ) 2 is 7 2 . 2 5 (when c = 9 ), ∴ ( b − 5 ) 2 + ( c − 0 . 5 ) 2 ≤ 8 8 . 2 5 ∴ ( a − 5 0 ) 2 ≥ 1 8 9 4 . But if a = 7 , 8 or 9 , ( a − 5 0 ) 2 ≤ 1 8 4 9 < 1 8 9 4 , so a ≤ 6 .
a ≥ 6 and a ≤ 6 ∴ a = 6 .
a = 6 ⇒ ( b − 5 ) 2 + ( c − 0 . 5 ) 2 = 4 6 . 2 5 . Also; ( b − 5 ) 2 ≥ 0 and as discussed earlier, ( b − 5 ) 2 ≤ 1 6 ∴ 3 0 . 2 5 ≤ ( c − 0 . 5 ) 2 ≤ 4 6 . 2 5 ∴ c = 6 or c = 7 .
We can now substitute in c = 6 and c = 7 into ( b − 5 ) 2 + ( c − 0 . 5 ) 2 = 4 6 . 2 5 and solve for b . For c = 6 , b = 1 or 9 . For c = 7 , b = 3 or 7 . Substituting these solutions back into the original equation, we can verify that they all work, hence our solutions are: 6 1 6 , 6 9 6 , 6 3 7 , 6 7 7 , adding these up gives 2 6 2 6 , so the last three digits are 6 2 6 .
We let the digits in the hundreds', tens' and ones' place be a , b and c respectively.
Then we will have the following equation: a 2 + b 2 + c 2 + 5 4 3 = 1 0 0 a + 1 0 b + c .
Since 0 ≤ a , b , c ≤ 9 , then we have 5 4 3 ≤ a 2 + b 2 + c 2 + 5 4 3 = 1 0 0 a + 1 0 b + c ≤ 5 4 3 + 3 × 9 2 = 7 8 6 . Thus, a = 5 , 6 or 7 .
Consider a = 5 . Then 2 5 + b 2 + c 2 + 5 4 3 = 5 0 0 + 1 0 b + c ⇒ 6 8 + b 2 + c 2 = 1 0 b + c . Since 6 8 + b 2 + c 2 ≥ 6 8 , then 1 0 b + c ≥ 6 8 and so b ≥ 6 . With this, we have 1 0 b + c = 6 8 + b 2 + c 2 ≥ 6 8 + 3 6 + c 2 = 1 0 4 + c 2 ≥ 1 0 4 . But 1 0 b + c ≤ 1 0 × 9 + 9 = 9 9 < 1 0 4 , so we arrive at a contradiction. Thus a cannot be 5 .
Next consider a = 7 . Then 4 9 + b 2 + c 2 + 5 4 3 = 7 0 0 + 1 0 b + c ⇒ b 2 + c 2 = 1 0 b + c + 1 0 8 . Since 1 0 b + c + 1 0 8 ≥ 1 0 8 , then b 2 + c 2 ≥ 1 0 8 and so b 2 ≥ 1 0 8 − c 2 ≥ 1 0 8 − 9 2 = 2 7 . This means b ≥ 6 . With this, we have b 2 + c 2 = 1 0 b + c + 1 0 8 ≥ 6 0 + c + 1 0 8 = 1 6 8 + c ≥ 1 6 8 . But b 2 + c 2 ≤ 9 2 + 9 2 = 1 6 2 < 1 6 8 , so we arrive at a contradiction. Thus a cannot be 7 .
Next consider a = 6 . Then 3 6 + b 2 + c 2 + 5 4 3 = 6 0 0 + 1 0 b + c ⇒ c 2 − c + ( b 2 − 1 0 b − 2 1 ) = 0 . So c = 2 1 ± 1 − 4 ( b 2 − 1 0 b − 2 1 ) = 2 1 ± 1 8 5 − 4 ( b − 5 ) 2 . Now we substitute b = 0 , 1 , … , 9 , keeping in mind that c must be a non-negative integer. The only solutions are ( b , c ) = ( 1 , 6 ) , ( 3 , 7 ) , ( 7 , 7 ) , ( 9 , 6 ) .
Therefore, all the three-digit numbers which satisfy the criteria in the question are 6 1 6 , 6 3 7 , 6 7 7 , 6 9 6 . Their sum is 2 6 2 6 , so the answer is 6 2 6 .
Let the three digit number be N = a b c , such that the hundreds, tens, and units digit of N are a , b , and c , respectively. Note that the maximum value of the sum of the squares of the digits of N is 3 ⋅ 9 2 = 2 4 3 , so a b c is at most 2 4 3 + 5 4 3 = 7 8 6 . Similarly, the sum or the squares of the digits must be positive, so the minimum value of N is 5 4 4 . Thus, 5 4 4 ≤ N ≤ 7 8 6 . Now, by the condition in the problem, we have 1 0 0 a + 1 0 b + c − ( a 2 + b 2 + c 2 ) = 5 4 3 a ( 1 0 0 − a ) + b ( 1 0 − b ) + c ( 1 − c ) = 5 4 3 . By our earlier bounds on N , a = 5 , 6 , or 7 . Also, note that by completing the square b ( 1 0 − b ) = − ( b + 5 ) 2 + 2 5 . Combining this with 0 ≤ b ≤ 9 gives 0 ≤ b ( 1 0 − b ) ≤ 2 5 . Similarly, we get c ( 1 − c ) = − ( c − 2 1 ) 2 + 4 1 . Combining this with 0 ≤ c ≤ 9 gives − 7 2 ≤ c ( 1 − c ) ≤ 0 . Now, we proceed with casework on the value of a .
Case 1: a = 5
We substitute a = 5 into our original equation and rearrange to get b ( 1 0 − b ) + c ( 1 − c ) = 6 8 . By our bounds, the maximum value of the LHS is 2 5 + 0 = 2 5 . Thus, this case yields no solutions.
Case 2: a = 6
We substitute a = 6 into our original equation and rearrange to get b ( 1 0 − b ) + c ( 1 − c ) = − 2 1 . Note that either c or ( 1 − c ) is even when c is an integer, so c ( 1 − c ) is even. Since the value of the RHS is odd, b ( 1 0 − b ) must be odd. Similarly, we see that b ( 1 0 − b ) is even when b is even and is odd when b is odd. Thus, we only have to test odd values of b , where 0 ≤ b ≤ 9 . When b = 1 , we find that 9 + c ( 1 − c ) = − 2 1 ⇒ c ( 1 − c ) = − 3 0 . By solving the quadratic or guessing and checking values, we find that the only value of c where 0 ≤ c ≤ 9 occurs when c = 6 . This gives the solution N = 6 1 6 . Continuing in this way, we the test b = 3 , 5 , 7 , 9 to find the solutions N = 6 3 7 , 6 7 7 , 6 9 6 .
Case 3: a = 7
We substitute a = 7 into our original equation and rearrange to get b ( 1 0 − b ) + c ( 1 − c ) = − 1 0 8 . However, by our earlier bounds, the minimum value of the LHS is 0 + ( − 7 2 ) = − 7 2 , so this case yields no solutions.
Finally, combining our cases, the only values of N that satisfy the conditions of the problem are 6 1 6 , 6 3 7 , 6 7 7 , 6 9 6 . Thus we have an answer of 6 1 6 + 6 3 7 + 6 7 7 + 6 9 6 ≡ 6 2 6 ( m o d 1 0 0 0 ) .
All numbers in the set are in the form 100x+10y+z=x^{2}+y^{2}+z^{2}+543, for the digits x, y and z which satisfy this equation.
Rewriting this equation, it becomes x(x-100)+y(y-10)+z(z-1)=543
Defining x' as x-50, y' as y-5, and z' as z-0.5, we can rewrite the left hand side of this equation as (x'-50)(x'+50)+(y'-5)(y'+5)+(z'-0.5)(z'+0.5). Simplified, that equals to (x'^2-50^{2})+(y'^2-5^{2})+(z'^2-0.5^{2}).
Thus, we have that x'^{2} +y'^{2} + z'^{2} = -543+50^{2}+5^{2}+ 0.5^{2} =1982.25
Note that the minimum value of y'^{2} is (5-5)^{2}=0 and the maximum value of y'^{2} is (0-5)^{2}=25, while the minimum value of z'^{2} is (0-0.5)^{2}=0.25 and the maximum value of z'^{2} is (9-0.25)^{2}=72.25.
Thus, y'^{2}+z'^{2} lies between 0+0.25 =0.25 and 25+72.25=97.25 .
This means |x-50|=x' lies between sqrt{1982.25-(y'^2+z'^{2})} and sqrt{1982.25-97.25} =43.4... and sqrt{1982.25-0.25} =44.5...
As this must be an integer, we find that |x-50| =44, which means x must be 50-44=6 .
This simplifies our equation to y'^{2}+z'^{2}=1982.25-44^{2}=46.25.
As before, keeping in mind the minimum and maximum values of y'^{2}, observe that |z-0.5|=|z'|=sqrt{46.25-y'^{2}} lies between sqrt{46.25-25}=4.6.... and sqrt{46.25-0}=6.8.... This means z lies between 0.5+4.6...=5.1 and 0.5+6.8...=7.3..., which tells us z must be either 6 or 7.
Finally, plugging those in, and calculating y=5+sqrt{46.25-(z-0.5)^{2}} and y=5-sqrt{46.25-(z-0.5)^{2}}, we get our four solutions: 616, 696, 637, and 677.
Adding these together and taking the last three digits, our final answer is 626.
Let x,y and z be the digits of the three-digit number. According to the question, 100x+10y+z-(x^2+y^2+z^2)=543 100x+10y+z-x^2-y^2-z^2=543 Thus,x (100-x)+y (10-y)+z (1-z)=0 Substituting x for numbers from 1 to 9(Since x is the first digit and thus cannot be 0),we get x (100-x)=99,196,291,384,475,564,651,736,819=a. Similarly,substituting y and z for numbers from 0 to 9, y (10-y)=0,9,16,21,24,25,24,21,16,9=b and z (1-z)=0,0,-2,-6,-12,-20,-30,-42,-56,-72=c If a=475, 475+b+c will be less than 543 as the highest value for 'b' is 25 and the value of 'c' is either 0 or negative. 475+25=500<543 Thus 'a' should be greater than 475. If a=651, 651+b+c will be more than 543 as the lowest value of 'c' is-72 and the value of 'b' is either 0 or positive. 651+-72=579>543 Thus 'a' should be less than 651. From the above two situations,we get,a=564 If c=-20, 564+b+-20=544+b will be more than 543 as 'b' is either 0 or positive. Thus 'c' should be less than -20. If c=-56, 564+-56+b=508+b will be less than 543 as the greatest value of 'b' is 25 and 508+25=533< 543. Thus 'c' should be more than -56. From the above two situations ,'c' can be -30 or -42. If c=-30, 564+-30+b=543 Then b=9. Then x=6,z=6 and y=1 or 9. Thus the numbers are 616 and 696. If c=-42, 564+-42+b=543 Then b=21. Thus x=6,z=7 and y=3 or 7. Thus the numbers are 637 and 677. Therefore, the required numbers are 616,696,637 and 677. 616+696+637+677=2626. Thus,the last three digits of their sum are 626.
let the 3digit numbers be of the form asd 10>a,s,d & a>0 &a,s,d are whole numbers
then 100
a+10
s+d=a^2+s^2+d^2+543
implies a>5
minimum value of s
(10-s) is 0 ........1
maximum value of d
(d-1) is 72 .........2
maximum value of a^2,d^2,s^2 is 81 ........3
maximum value of s
(10-s) is 25 ........4
case-1 (a=6)
600+s
(10-s)=d
(d-1)+6^2+543
s
(10-s)=d
(d-1)-21
from 1&4
46>d
(d-1)>20
implies 8>d>5
trying d=7,6
when d=6,s=1,9
when d=7,s=3,7
therefore the numbers are 616,696,677,637
case-2 (a=7)
700+s
(10-s)=d
(d-1)+7^2+543
s
(10-s)=d
(d-1)-108
from 2&1
therefore 3digit number starting in 7 is not possible
as a increases from 1 to 50
100^a-a^2 = a
(100-a)also increases(by inverse of am-gm inequality)
therefore s
(10-s)=d*(d-1)-K
where K>108
therefore no other number exist
let the number be of the form ' abc ';
where a,b,c can be any digit from 0-9 ;
or in other words it can be written as '100a+10b+c';
the difference of the number and sum of its digits' square is 543 or
100a-a^2+10b-b^2+c-c^2=543;
=> a(100-a)+b(10-b)+c(1-c)=543;
possible values of c(1-c) are :
c=0 ; c(1-c)=0;
c=1 ; c(1-c)=0;
c=2 ; c(1-c)=(-2);
c=3 ; c(1-c)=(-6);
c=4 ; c(1-c)=(-12);
c=5 ; c(1-c)=(-20);
c=6 ; c(1-c)=(-30);
c=7 ; c(1-c)=(-42);
c=8 ; c(1-c)=(-56);
c=9 ; c(1-c)=(-72);
similarly posibble values of b(10-b) are :
b=0 ;b(10-b)=0;
b=1 ;b(10-b)=9;
b=2 ;b(10-b)=16;
b=3 ;b(10-b)=21;
b=4 ;b(10-b)=24;
b=5 ;b(10-b)=25;
b=6 ;b(10-b)=24;
b=7 ;b(10-b)=21;
b=8 ;b(10-b)=16;
b=9 ;b(10-b)=9;
the number has to be greater than 543; so 'a' can be 5,6,7,8,9; => a(100-a) can be 475,564,651,736,819;
since all possible values of c(1-c) are 0 or negative ; =>b(10-b)+c(1-c) can have minimum value of (-72);
=>a(100-a) cannot be greater than 564;
example: suppose a(100-a)=651;
so the equation becomes;
651+b(10-b)+c(1-c)=543;
=>108+b(10-b)+c(1-c)=0 this not possible because 'b(10-b)+c(1-c)' has minimum value =(-72) and (108-72) not equal to 0;
let a(100-a)=475;
=>475+b(10-b)+c(1-c)=543;
=>b(10-b)+c(1-c)=68;
but this is also not possible as b(10-b)+c(1-c) has maximum value 25;
so only possible value of a(100-a)=564;
now the equation becomes;
564+b(10-b)+c(1-c)=543;
=>21+b(10-b)+c(1-c)=0;
checking for possible values of b(10-b) and c(1-c);
we find that b(10-b) can have value equal to 9 or 21;
and corresponding values of c(1-c) are (-30) and (-42);
=>for b=1 or 9 we have b(10-b)=9 and c(1-c)=(-30) for c=6;
so number can be;
616 or 696;
and for b(10-b)=21 ; b=3 or 7; and c(1-c)=(-42) for c=7;
so number can be ;
637 or 677;
sum of numbers =616+637+677+696= 2626;
=> last three digits are : 626 ;
"a(100-a) cannot be greater than 564" meant "a(100-a) cannot be less than 564" More of a brute force solution than necessary
Log in to reply
Since there is no space to give a solution, and the solution below has completely different approach, I am posting it. L e t L H S = 5 4 3 + a 2 + b 2 + c 2 , R H S = a b c = 1 0 0 a + 1 0 b + c . We will first see the range of abc. R H S > 5 4 3 . a b c m a x = 9 9 9 . ∴ R H S m a x = 5 4 3 + 3 ∗ 9 2 = 7 8 6 . 5 4 3 < R H S < 7 8 6 . Next, for each a and b, (within the range), we will cycle c from 0 to 9. For a=5, we cycle b from 4 to 9..... For a=6, from 0 to 9..... For a=7, from 0 to 8. However we shall not go through all the values. We will apply shortcuts. L e t R H S = X X X , f o r w h i c h L H S = Y Y Y . When c is increased, RHS will never grow faster than LHS. ∴ At any point, if LHS>RHS, c cycle over. So if XX0<YYY, no solution for RHS= XX0 to XX9. S e e a b c = 5 5 0 , 5 6 0 , . . . , b e l o w . When LHS \leq RHS, and if n in XXn is increased by 1,for next R H S n + 1 , R H S n + 1 − L H S n + 1 = Δ c = c 2 − c = ( c − 1 ) ∗ c w h e r e c = n + 1 F o r c = 0 Δ c = 0 = 0 : f o r c = 1 Δ c = 1 = 0 : f o r c = 2 Δ c = 2 = 2 : f o r c = 3 Δ c = 3 = 6 : f o r c = 4 Δ c = 4 = 1 2 : f o r c = 5 Δ c = 5 = 2 0 : f o r c = 6 Δ c = 6 = 3 0 : f o r c = 7 Δ c = 7 = 4 2 : f o r c = 8 Δ c = 7 = 5 6 : f o r c = 9 Δ c = 9 = 7 2 : I f D = a n y o f t h e Δ c g i v e n a b o v e , N O s o l u t i o n f o r t h a t c c y c l e . S e e a b c = 6 0 0 , 6 2 0 , 6 4 0 , 6 5 0 , 6 7 0 , b e l o w . When LHS>RHS+25, from any value of b than Xb0 to X90 has no solution. Coming to increasing b from 0 to n. RHS increases by 10n. LHS increases by n 2 . Since n=0,1,2 . . . 9, Δ b = i n c r e a s e i n R H S − i n c r e a s e i n L H S = 1 0 n − n 2 . Δ b m a x = 2 5 . ∴ If RHS>LHS+25, Xb0 to Xb9 have no solution. S i n c e Δ c m a x = 7 2 , i f R H S > L H S + 7 2 , X X 0 t o X X 9 f o r t h i s h a s n o s o l u t i o n . S e e a b c = 7 0 0 , 7 1 0 , . . . 7 8 Let D=XX0-YYY. If D=0, XX0 and XX1 are the solutions. F o r D > 0 , i f D = Δ n , c o r r o s p o n d i n g c = n , t h a t i s X X n i s t h e o n l y s o l u t i o n f r o m X X 0 t o X X 9 . S e e a b c = 6 1 0 , 6 3 0 , 6 7 0 , 6 9 0 , b e l o w . S i n c e Δ m a x = Δ 9 = 7 2 , i f D > 7 2 , N o S o l u t i o n .
W i t h t h e a b o v e b a c k g r o u n d : −
R H S = 5 4 3 i s t h e l o w e r b o u n d . R H S = 5 4 0 , L H S = 5 8 4 > R H S . R H S = 5 5 0 , L H S = 5 9 3 > R H S R H S = 5 6 0 , L H S = 6 0 4 > R H S . R H S = 5 7 0 , L H S = 6 1 7 > R H S . R H S = 5 8 0 , L H S = 6 3 2 > R H S R H S = 5 9 0 , L H S = 6 4 9 > R H S . R H S = 6 0 0 , L H S = 5 7 9 . D = 2 1 = Δ c . N o s o l u t i o n f o r 6 0 0 t o 6 0 9 . R H S = 6 1 0 , L H S = 5 8 0 , D = 3 0 = Δ 6 . ∴ 6 1 6 i s a s o l u t i o n . R H S = 6 2 0 , L H S = 5 8 3 , D = 3 7 = Δ c . N o s o l u t i o n f o r 6 2 0 t o 6 2 9 . R H S = 6 3 0 , L H S = 5 8 8 , D = 4 2 = Δ 7 . ∴ 6 3 7 i s a s o l u t i o n . R H S = 6 4 0 , L H S = 5 9 5 , D = 4 5 = Δ c . N o s o l u t i o n f o r 6 4 0 t o 6 4 9 . R H S = 6 5 0 , L H S = 6 0 4 , D = 5 4 = Δ c . N o s o l u t i o n f o r 6 5 0 t o 6 5 9 . R H S = 6 6 0 , L H S = 6 1 5 , D = 4 5 = Δ c . N o s o l u t i o n f o r 6 6 0 t o 6 6 9 . R H S = 6 7 0 , L H S = 6 2 8 , D = 4 2 = Δ 7 . ∴ 6 7 7 i s a s o l u t i o n . R H S = 6 8 0 , L H S = 6 4 3 , D = 3 7 = Δ c . N o s o l u t i o n f o r 6 8 0 t o 6 8 9 . R H S = 6 9 0 , L H S = 6 6 0 , D = 3 0 = Δ 6 . ∴ 6 9 6 i s a s o l u t i o n . R H S = 7 0 0 , L H S = 5 9 2 , D = 1 0 8 > 7 2 : R H S = 7 1 0 , L H S = 5 9 3 , D = 1 1 7 > 7 2 R H S = 7 2 0 , L H S = 5 9 6 , D = 1 2 4 > 7 2 : R H S = 7 3 0 , L H S = 6 0 1 , D = 1 2 9 > 7 2 R H S = 7 4 0 , L H S = 6 0 8 , D = 1 3 2 > 7 2 : R H S = 7 5 0 , L H S = 6 1 7 , D = 1 3 3 > 7 2 R H S = 7 6 0 , L H S = 6 2 8 , D = 1 3 2 > 7 2 : R H S = 7 7 0 , L H S = 6 4 1 , D = 1 2 9 > 7 2 R H S = 7 8 0 , L H S = 6 5 6 , D = 1 2 4 > 7 2 : A N S W E R 6 1 6 + 6 3 7 + 6 7 7 + 6 9 6 = 2 6 2 6 Note the pattern in D. D for XbX is same as D for X(10-b)X. Since solution is based on D, this reflects in the answer also, X b X t h e n X ( 1 0 − b ) X . T h u s w e c a n c u t o u r w o r k b y h a l f . We can calculate D for 610, 690 will have same D, for 620 and 680, … … I had first solved the problem through TI-83 PLUS before trying to apply logic.
Let N = a b c and a = 0 , 0 ≤ a , b , c ≤ 9
According to the problem we have: a 2 + b 2 + c 2 + 5 4 3 = 1 0 0 a + 1 0 b + c
Since I can't really find a proper way to factor this, I will complete the square of the individual variables. Thus, we can rewrite the above as:
( a − 5 0 ) 2 + ( b − 5 ) 2 + 4 1 ( 2 c − 1 ) 2 = ( 2 5 0 0 + 2 5 + 4 1 ) − 5 4 3 = 1 9 8 2 + 4 1 ( 2 a − 1 0 0 ) 2 + ( 2 b − 1 0 ) 2 + ( 2 c − 1 ) 2 = 7 9 2 9
Now ( 2 a − 1 0 0 ) 2 < = 7 9 2 9 and, ( 2 a − 1 0 0 ) 2 < = 8 9 2 . The max value of the other two expressions can be 1 0 0 and 1 7 2 respectively. So ( 2 a − 1 0 0 ) 2 ≥ 7 9 2 9 − 3 8 9 > 8 6 2 . Combining the above gives us that 8 6 2 < ( 2 a − 1 0 0 ) 2 ≤ 8 9 2 Thus, a = 6 is the only possible value since ( 2 a − 1 0 0 ) 2 is an even perfect square and hence can only equal 8 8 2 .
The new equation transforms to: ( 2 b − 1 0 ) 2 + ( 2 c − 1 ) 2 = 7 9 2 9 − 8 8 2 = 1 8 5
1 8 5 = 1 3 2 + 4 2 = 1 1 2 + 8 2
Keep in mind that ( 2 b − 1 0 ) 2 is an even perfect square.
Case 1: ( 2 b − 1 0 ) 2 = 4 2 = ± 4 ⇒ 2 b = 1 4 , 6 ⇒ b = 7 , 3 ( 2 c − 1 ) 2 = 1 3 2 = ± 1 ⇒ 2 c = 1 4 , − 1 2 ⇒ c = 7
Possible numbers are : 6 7 7 , 6 3 7
Case 2: ( 2 b − 1 0 ) 2 = 8 2 = ± 8 ⇒ 2 b = 1 8 , 2 ⇒ b = 9 , 1 ( 2 c − 1 ) 2 = 1 1 2 = ± 1 1 ⇒ 2 c = 1 2 , − 1 0 ⇒ c = 6 ,
Possible numbers are : 6 9 6 , 6 1 6
Sum of all possible numbers is = 2 6 9 6 The next part is trivial.
Somewhere in the middle, I would just like to remark that 7 9 2 9 > 8 9 2 , so a better way would be to write: ( 2 a − 1 0 0 ) 2 < 9 0 2 .
Log in to reply
Not much difference though right? It has to be an integer so it can't be 9 0 2
How did you find the max value for ( 2 b − 1 0 ) 2 and ( 2 c − 1 ) 2 ?
Log in to reply
For ( 2 b − 1 0 ) 2 maximum occurs clearly at b = 0 , and for ( 2 c − 1 ) 2 its occurs when c = 9 . For clarity observe the following inequality: 0 ≤ b ≤ 9 − 1 0 ≤ 2 b − 1 0 ≤ 8
So the max possible value of the square of the expression is 1 0 0 . You can similarly work it out for ( 2 c − 1 ) 2 .
Because 9^2+9^2+9^2+543=786. The only possible first digit numbers are 5, 6, or 7. We get the equation a^2+b^2+c^2+543=100a+10b+c. When you plug in a=5, you find that there are no solutions. For a=6, you (1,6), (3,7), (7,7), and (9,6). For a=7, you also find no solutions. So the numbers are 616+637+677+696=2626
10 weeks ago August 12 to 18 Level 4 Problem 3 was the same problem!
Yea, I thought I had seen this problem before.
yes it sound familiar when I solved it
see here : https://brilliant.org/assessment/s/algebra-and-number-theory/3551822/
a 2 + b 2 + c 2 + 5 4 3 = 1 0 0 a + 1 0 b + c
The maximum value of sum of three squares can be 243. Thus the maximum value of the number can be 786. Minimum of course is 544. This implies can a can only be 5, 6 or 7.
b 2 + c 2 + 6 8 = 1 0 b + c
The RHS is a two digit number greater than 68. It's obvious that no value of b & c will satisfy the equation.
b 2 + c 2 - 1 0 8 = 1 0 b + c
For the LHS to be positive the only combinations of b,c that work are (9,9), (9,8), (8,8) & (9,7). No pair qualifies.
b 2 + c 2 - 2 1 = 1 0 b + c
( b − 5 ) 2 + c 2 = 4 6 + c
( b − 5 ) 2 can only be 0,1,4,9,16. So c 2 - c can only be 46, 45, 42, 37, 30. Clearly 42 and 30 qualify resulting in c as either 7 or 6. Solve for b and we have 4 numbers.
6 7 7 , 6 3 7 , 6 9 6 , 6 1 6 that adds up to 2 6 2 6
L.H.S.=a^2+b^2+c^2+543 = abc=R.H.S.~~~~abc=100a+10b+c.\\ R.H.S.>543.~~~R.H.S.=543\\ L.H.S.=543+25+16+9=593.\\ But ~if~ L.H.S.>R.H.S.~~uptill~ 100a+10b+9~~\text{there can be no solution.}\\ So ~uptill~549~there~is~no~solution.\\ \text{There is a solution in the rage c=0 to 9 only if YY0-XXX is as given below.}\\ \text{the solution is XXc. \\ ~~~~~Let~~~L.H.S.=XXX~~~~~~~~~~~~R.H.S.=YY0\\ c=0~~~~YY0~-~XXX= \color{#D61F06}{ 0 } ~~~~~~~~~~~R.H.S.=YY0\\ c=1~~~~YY0~-~XXX= \color{#D61F06}{ 0 }~~~~~~~~~~~~R.H.S.=YY1\\ c=2~~~~YY0~-~XXX= \color{#D61F06}{ 2}~~~~~~~~~~~~R.H.S.=YY2\\ c=3~~~~YY0~-~XXX= \color{#D61F06}{ 6|~~~~~~~~~~~~R.H.S.=YY3\\ c=4~~~~YY0~-~XXX= \color{#D61F06}{12}~~~~~~~~~~~~R.H.S.=YY4\\ c=5~~~~YY0~-~XXX= \color{#D61F06}{20}~~~~~~~~~~~~R.H.S.=YY5\\ c=6~~~~YY0~-~XXX= \color{#D61F06}{30}~~~~~~~~~~~~R.H.S.=YY6\\ c=7~~~~YY0~-~XXX= \color{#D61F06}{42}~~~~~~~~~~~~R.H.S.=YY7\\ c=8~~~~YY0~-~XXX= \color{#D61F06}{56}~~~~~~~~~~~~R.H.S.=YY8\\ c=9~~~~YY0~-~XXX=\color{#D61F06}{72}~~~~~~~~~~~~R.H.S.=YY9\\
1 2 3 4 5 6 7 8 9 10 11 12 |
|
javascript version
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
sum=0;
for i=1:999
a=(rem(i,10))^2;
a=a+rem(floor(i/10),10)^2;
a=a+(floor(i/100))^2;
if (i-a==543)
sum=sum+i;
end
end
ans =
2626
int main() { int a=0, b=0, c=0, sum=0;
for(a=0; a<10; a++)
{
for(b=0; b<10; b++)
{
for(c=0; c<10; c++)
if( 100*a + 10*b + c == 543 + a*a + b*b + c*c)
sum = sum + 100*a + 10*b + c;
}
}
printf("%d", sum);
}
Let x=abc the three digits number. Then x= a 2 + b 2 + c 2 +543 and x=100a+10b+c; we group the terms: b 2 -10b + c 2 -c = 100a - a 2 - 543, or ( b − 5 ) 2 + c(c-1) = 100a - a 2 - 543 + 25. Number 'a' could take the values 9 to 5. Only for a=7 we obtain solutions: ( b − 5 ) 2 + c(c-1)=83 ; ( b − 5 ) 2 could be 25, 16, 9, 4, 1 or 0 and c(c-1) could be 72, 56, 42, 30, 20, 12, 6, 2, 0. For c=6, b=1 or b=9; for c=7, b=3 or b=7. The thrilling numbers are 616, 696, 637, 677 with their sum 2628. Last three digits ... 626 :)
Can you expand on your statement: "Number 'a' could take the values 9 to 5."? Why not values 0-4? Also, for a=7, I get 700-49-543+25=133, not 83.
I'm really sorry, it's my mistake. About first part, x>543, so a>=5. The main statement is completely different (my hurry and messed up papers). The right one is following. * Only for a=6 we obtain solutions. (b−5)^2 + c(c-1)=46 * . The rest of solution is correct, I hope.
Problem Loading...
Note Loading...
Set Loading...
All three-digit numbers that satisfy are of the form a b c = 1 0 0 a + 1 0 b + c = 5 4 3 + a 2 + b 2 + c 2 , with a , b , c being three single-digit (non-negative) numbers. Rearrangement yields a ( 1 0 0 − a ) = b ( b − 1 0 ) + c ( c − 1 ) + 5 4 3 . We know that − 2 5 0 ≤ b ( b − 1 0 ) ≤ 0 , ≤ c ( c − 1 ) ≤ 7 2 , so − 2 5 ≤ b ( b − 1 0 ) + c ( c − 1 ) ≤ 7 2 and equivalently 5 1 8 ≤ b ( b − 1 0 ) + c ( c − 1 ) + 5 4 3 ≤ 6 1 5 or 5 1 8 ≤ a ( 1 0 0 − a ) ≤ 6 1 5 ⟹ a = 6 . Then a b c = 1 0 0 a + 1 0 b + c = 6 0 0 + 1 0 b + c = 5 4 3 + 3 6 + b 2 + c 2 , implying 1 0 b + c + 2 1 = b 2 + c 2 ⟹ c ( c − 1 ) = b ( 1 0 − b ) + 2 1 . By plugging in different values of b , it is easily verifiable that ( a , b , c ) ∈ { ( 6 , 1 , 6 ) , ( 6 , 9 , 6 ) , ( 6 , 3 , 7 ) , ( 6 , 7 , 7 ) } . The sum of the corresponding numbers is 6 1 6 + 6 9 6 + 6 3 7 + 6 7 7 = 2 6 2 6 and hence the answer is 2 6 2 6 .