X 2 = 2 0 1 7 . . . Find the smallest positive integer X such that the first 4 digits of X 2 are 2017.
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.
A lot of guess and checking makes programming a reasonable solution (java code)
1 2 3 4 5 6 7 8 9 10 11 12 |
|
I think this question can also be done by traditional method of finding square roots
2 0 1 7 is not an integer, so it cannot be X 2 .
2 0 1 7 0 ⋯ 0 < X < 2 0 1 8 0 ⋯ 0 , for the same number of trailing 0's:
1 4 2 < 2 0 , 1 7 0 < X < 2 0 , 1 8 0 < 1 4 3 , not possible.
4 4 9 < 2 0 1 , 7 0 0 < X < 2 0 1 , 8 0 0 < 4 5 0 , not possible.
1 4 2 0 < 2 , 0 1 7 , 0 0 0 < X < 2 , 0 1 8 , 0 0 0 < 1 4 2 1 , not possible.
2 0 , 1 7 0 , 0 0 0 < 4 4 9 2 ≤ X ≤ 4 4 9 2 < 2 0 , 1 8 0 , 0 0 0 , possible for X = 4 4 9 2 .
Oh this is much clearer than the other solutions because we don't need to know the square roots of 2017 and 2018.
This is my favorite. Thanks for sharing!
This is a good solution but isn't justified very well. Who says the digits that follow 2017 must be 0's? Why can't we consider 201,798?
Log in to reply
We consider every number between 201,700 and 201,800, therefore 201,798 is included.
The square root of 2017 is 44.9... which is not an integer.
The next possible answer is the smallest positive integer of the square roots of 2017n (5 digits) where n is 0-9. We could try all 10 values in ascending order and stop if we find a positive integer, but there is a faster approach. In order for X^2 to be within 2017n (let's call that the "solution range"), X must be must be between the square roots of 20170 and 20179, i.e. there must be a positive integer between the square roots of 20170 and 20179. In order for this to be true, the integer portion of the square root of 20179 must be strictly larger than the integer portion of the square root of 20170. If not, we will keep adding a digit until there is a positive integer between the square roots of the smallest and largest numbers in the solution range .
For 2017n:
There is no positive integer between 142.02... and 142.05...
For 2107nn:
There is no positive integer between 449.11... and 449.22...
For 2107nnn:
There is no positive integer between 1420.21... and 1420.56...
For 2107nnnn:
There is one positive integer between 4491.10... and 4492.21... and it is 4492 .
If there were more than one positive integer in the range, we would just choose the smaller of the two.
wolframalpha
solve over the integers x^2=20170000+y, 0<y<=9
result
4491.1<Re(x)<4492.22
meaning x=4492
nice solution!
Note that 44^2=1936,45^2=2025.So we must go to 440.(Since we can't get into fractions,hence we increase 1 place of decimal).440^2=193600,449^2=201601(2016...so close!!),but 450^2=202500,we now move to 4491^2=20179081,4492^2=20178064=2017....& job is done. :)
You're skipping over the possibility that the solution X^2 = 2017* has an odd number of digits.
I didn't quite get it....can you pls explain further??
long x = 1;
long y;
void setup() {
Serial.begin(9600);
}
void loop() {
y = pow(x, 2);
Serial.println(y);
while (y >= 10000) {
y = y / 10;
}
if (y == 2017) {
Serial.print("The value of x is: ");
Serial.print(x);
while (1) {
}
}
x++;
}
The code above gives the value of x in a couple of seconds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
1 |
|
Problem Loading...
Note Loading...
Set Loading...
For X 2 to have starting digits of 2017. This simply means that 2 0 1 7 × 1 0 n ≤ X 2 < 2 0 1 8 × 1 0 n
Now before taking square roots on both sides, we have to check that whether n is odd or even.
Considering both the cases:
n odd: 1 4 2 . 0 2 1 1 2 5 1 8 9 … × 1 0 k ≤ X < 1 4 2 . 0 5 6 3 2 6 8 5 7 … × 1 0 k
n even: 4 4 . 9 1 1 0 2 3 1 4 5 8 … × 1 0 k ≤ X < 4 4 . 9 2 2 1 5 4 8 9 0 4 … × 1 0 k
When n is odd, as we vary k , the smallest integer X will be 14203.
When n is even, as we vary k , the smallest integer X will be 4 4 9 2 .