A digit reversal

Let S S be the number obtained by writing all the numbers from 1 to 100 in order, and removing the spaces in between. Let T T be the number obtained by writing all the numbers from 1 to 100 in reverse order and removing the spaces in between.

What is the remainder when T 2 S 2 T^2 - S^2 is divided by 1000 1000 ?

Details and assumptions

The number obtained by writing all the numbers from 1 to 10 in reverse order and removing the spaces in between, is 10987654321 10987654321 .


The answer is 41.

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.

16 solutions

Taehyung Kim
Aug 25, 2013

We know that T = 321 ( m o d 1000 ) T = 321 \pmod{1000} and S = 100 ( m o d 1000 ) S = 100 \pmod{1000} . Thus we see that T 2 S 2 = 32 1 2 10 0 2 = 103041 0 = 41 ( m o d 1000 ) T^2 - S^2 = 321^2 - 100^2 = 103041 - 0 = 41 \pmod {1000}

Won't Tsquared be smaller than Ssquared? They have the same number of digits, but S starts 123 while T starts 100. Can you have a negative remainder?

Max Sosna-Spear - 7 years, 9 months ago

Log in to reply

It is intentional that T T is less than S S , which caused several students a problem.

To answer your question, what is the remainder when 123 -123 is divided by 1000?

Calvin Lin Staff - 7 years, 9 months ago

That is exactly my solution.

Adhiraj Mandal - 7 years, 9 months ago
Ho Wei Haw
Aug 26, 2013

We have S = 12345678910...100 100 m o d 1000 S=12345678910...100\equiv 100\bmod 1000 S 2 10 0 2 m o d 1000 0 m o d 1000 \Rightarrow S^2 \equiv 100^2 \bmod 1000\equiv 0 \bmod 1000

Also,

T = 1009998...321 321 m o d 1000 T=1009998...321\equiv321\bmod1000 T 2 32 1 2 m o d 1000 41 m o d 1000 \Rightarrow T^2\equiv 321^2\bmod1000\equiv 41\bmod1000

T 2 S 2 41 0 m o d 1000 41 m o d 1000 T^2-S^2\equiv 41-0\bmod1000\equiv 41 \bmod1000

R e m a i n d e r = 41 \therefore Remainder = 41

Thought of another solution in school today without the use of modular arithmetic :P

S = 123456789...99100 = 123456789...99000 + 100 S=123456789...99100=123456789...99000 + 100

S 2 = ( 12345...99000 ) 2 + 2 ( 12345...99000 ) ( 100 ) + 10 0 2 S^2=(12345...99000)^2+2(12345...99000)(100)+100^2

Clearly, all the numbers here are divisible by 1000

Similarly,

T 2 = ( 1009998...4000 + 321 ) 2 T^2=(1009998...4000+321)^2

T 2 = 1009998...400 0 2 + 2 ( 1009998...4000 ) ( 321 ) + 32 1 2 T^2 = 1009998...4000^2 + 2(1009998...4000)(321)+321^2

So, evidently, 32 1 2 321^2 is the only number that will give us a remainder when divided by 1000.

Hence, finding the remainder of T 2 S 2 T^2-S^2 when divided by 1000 is equivalent to finding the remainder of 32 1 2 321^2 when divided by 1000.

Therefore, the remainder is 41.

Ho Wei Haw - 7 years, 9 months ago

Log in to reply

Your solutions actually say the same thing, but in a slightly different language. Modular arithmetic is powerful because it allows us to express a complicated idea in a simple form.

Just imagine how hard algebra is, if you were asked to solve

Find a positive number such that what it is squared and added to three, it is equal to 4 times of itself.

Calvin Lin Staff - 7 years, 9 months ago
Tim Vermeulen
Aug 26, 2013

We wish to find T 2 S 2 ( m o d 1000 ) T^2 - S^2 \pmod{1000} . The last three digits of S S are 100 100 , so

S 2 0 ( mod 1000 ) T 2 S 2 T 2 ( mod 1000 ) . S^2 \equiv 0\text{ }(\text{mod } 1000) \implies T^2 - S^2 \equiv T^2\text{ }(\text{mod } 1000).

The last three digits of T T are 321 321 , so

32 1 2 = 103041 T 2 41 ( mod 1000 ) . 321^2 = 103041 \implies T^2 \equiv \boxed{41}\text{ }(\text{mod } 1000).

Harrison Lian
Aug 26, 2013

The question is asking for T 2 S 2 x ( m o d 1000 ) T^2-S^2 \equiv x \pmod{1000} , where x is the remainder. Since it's asking for the last 3 digits, we would only care about the last three digits of those huge numbers.

So T = 321 and S = 100 T=321 \text{ and } S=100 .

Calculating T 2 S 2 ( m o d 1000 ) T^2-S^2 \pmod{1000} , we get 41 \boxed{41}

Be very careful, the question is not asking about the last 3 digits of a number.

Calvin Lin Staff - 7 years, 9 months ago
Josh Petrin
Aug 27, 2013

Since we are only asked to find the remainder when T 2 S 2 T^2 - S^2 is divided by 1000 1000 , we need only find the last three digits of each of the numbers; then we can find the answer.

First, since S S is the first 100 100 numbers written in increasing order without spaces, S S has last three digits 100 100 . Also, we know that T T has last three digits 321 321 .

Now we calculate the last three digits of S 2 S^2 and T 2 T^2 . Since the last three digits of S 2 S^2 are only dependent on the last three digits of S S , the last three digits of S 2 S^2 are the last three digits of 10 0 2 = 10000 100^2 = 10000 , which is 000 000 . Similarly, the last three digits of T 2 T^2 are the last three digits of 32 1 2 = 103041 321^2 = 103041 , which are 041 041 .

So, our final answer is 41 0 = 41 41 - 0 = \boxed{41} .

Tilak Patel
Aug 27, 2013

S = 12345......99100 S = 12345......99100

T = 10099......54321 T=10099......54321

T 2 S 2 = ( T + S ) ( T S ) T^{2} - S^{2} = (T + S)(T - S)

= ( . . . . . 321 + . . . . . . 100 ) ( . . . . . 321 . . . . . . 100 ) = (.....321 + ......100)(.....321 - ......100)

= ( . . . . . . 421 ) ( . . . . . . . 221 ) = (......421)(.......221)

= . . . . . . . . . 041 =.........041

Hence, Remainder = 42

Sorry, the last statement has a mistake, the remainder comes as 41

Tilak Patel - 7 years, 9 months ago

Log in to reply

I disagree that the last three digits of T S T-S are 221. What is 4321 9100 4321 - 9100 ?

This actually gives some insight into the other statements expressing confusion which other students stated.

Calvin Lin Staff - 7 years, 9 months ago

Log in to reply

this is just an assumption.If we see first 4 to 5 digits of T and S then we will find that T > S T>S .If you solve T S T - S conventionally by solving on paper you will find last three digits as 221.You will find last three digits as 221 if you solve T S T - S by considering all the digits of T and S will will be hard to compute.

Tilak Patel - 7 years, 9 months ago

Log in to reply

@Tilak Patel Precisely. You have to find the last three digits of a number by considering all of the digits, which you have not done so.

You need to justify that "the last three digits are 221", which I disagree with.

Calvin Lin Staff - 7 years, 9 months ago
Caio Pelicioni
Sep 5, 2013

Given that: S = 12345...99100 S = 12345...99100 We have: S 100 ( m o d 1000 ) S ≡ 100 (mod 1000) S 2 10 0 2 0 ( m o d 1000 ) S^{2} ≡ 100^{2} ≡ 0 (mod 1000)

Now, given that: T = 10099..54321 T = 10099..54321 We have: T 321 ( m o d 1000 ) T ≡ 321 (mod 1000) T 2 32 1 2 41 ( m o d 1000 ) T^{2} ≡ 321^{2} ≡ 41 (mod 1000)

At this point, we have: T 2 S 2 41 0 ( m o d 1000 ) T^{2} - S^{2} ≡ 41 - 0 (mod 1000) T 2 S 2 41 ( m o d 1000 ) T^{2} - S^{2} ≡ 41 (mod 1000)

Thus, our wanted remainder is 41 41 .

Snehdeep Arora
Sep 1, 2013

S = 123....................9899100

T = 1009998...................321

T 2 S 2 T^{2}-S^{2} = ( T + S ) ( T S ) (T+S)(T-S) =(1009998.......321-123......9899100) (1009998.......321+123.....9899100) =(........221)(......421)=..........93041

the number obtained would be exactly divisible by 1000 if there are three 0s at the end so remainder = 41 as when 41 is subtracted from ........93041 the number becomes exactly divisible by 1000

Tran Dinh Duy Vu
Aug 30, 2013

The last two digits of S is "00" , so the last four digits of S^{2} T can be expressed as T=(1000a + 4321) so T^{2} = a\times 10^{6} + 2a\times 4321\times 1000 + 4321^{2} It is obvious that the last three digits of T^{2} is the last three digits of 4321^{2} = 041 Therefore, the answer is 041 ( which is the last three digits of T^{2} - S^{2})

Actually , the question is indirectly asking the last three digits of T 2 S 2 T^2 - S^2 . Finding last three digits of S 2 S^2 and T 2 T^2 , S 2 = 0000 , T 2 = 041 S^2 = \dots0000 , T^2 = \dots041 . Hence T 2 S 2 = 041 T^2 - S^2 = \dots041 and thus , answer is 41 \fbox{41}

Moderator note:

You should be careful with your claim. This question does not ask for the last three digits of T 2 S 2 T^2 - S^2 .

I disagree with your first line. Think about why it is false.

Calvin Lin Staff - 7 years, 9 months ago

Log in to reply

i couldn't get why it is false , it seems obvious , please explain ..

kushagraa aggarwal - 7 years, 9 months ago

Log in to reply

T 2 S 2 ( m o d 1000 ) T^2 - S^2 \pmod{1000} only equals the last three digits of T 2 S 2 T^2-S^2 if it is positive, i.e. T > S T > S .

Tim Vermeulen - 7 years, 9 months ago
Waldir F. Caro
Aug 28, 2013

The rest of the product of two numbers can be of the follo form:

(a * b) % x = ( (a % x) * (b % x) ) % x

and the difference too:

(a - b) % x = ( (a % x) - (b % x) ) % x

where m % x represent the rest of divide the number m between the number x

Since T = ...54321 and S = ...9899100 Then fwe have that T % 1000 = 321 and S % 1000 = 100

then

(T² - S²) % 100 = ((T² % 1000) - (S² % 1000)) % 1000 = (((T % 1000) * (T % 1000)) % 1000 - ((S % 1000) * (S % 1000)) %1000) % 1000 = ((321 * 321) % 1000 - (100 * 100) % 1000) % 1000 = (103041 % 1000 - 10000 % 1000) % 1000 = 41

Barometer Nongbri
Aug 28, 2013

Last 3 digits of S are 100 so S^2 is divisible by 1000 Last 3 digits of T are 321 . So last 4 digits of T^2 are 3041 . when divided by 1000 remainder is 41

Jan J.
Aug 27, 2013

Note that any number is congruent to its last three digits modulo 1000 1000 , hence $$S \equiv 100 \pmod{1000}$$ $$T \equiv 321 \pmod{1000}$$ so $$T^2 - S^2 \equiv 321^2 - 100^2 \equiv 221 \cdot 421 \equiv \boxed{41} \pmod{1000}$$

Patrick Lin
Aug 26, 2013

Since we need only T 2 S 2 T^2 - S^2 mod 1000 we can just look at T T and S S each mod 1000.

The last three digits of T T are 321 321 , so T 2 = 041 T^2 = 041 mod 1000. Similarly, S 2 = 000 S^2 = 000 mod 1000, so the desired answer is 041 000 = 041 041 - 000 = 041 .

Ivan Sekovanić
Aug 26, 2013

First of all, let us notice that S = 1234 9899100 S=1234\dots 9899100 and T = 1009998 4321 T=1009998\dots 4321 . Now, in order for a number to be divisible by 1000 1000 we know that the last 3 3 digits of the number need to be zeros, which we will use later on. Also, since T T and S S are very big integers, we will only use the last couple of digits in them to solve the problem, since the rest are not needed at all.

Therefore

S 2 = a b c d 3610000 S^{2}=\overline {abcd\dots 3610000}

T 2 = m f g n 9971041 T^{2}=\overline {mfgn\dots 9971041}

On the other hand, T 2 S 2 = p q r s 6361041 T^{2}-S^{2}=\overline{pqrs\dots 6361041} .

According to the Remainder Theorem, x = y q + r x r = y q x=yq+r \Rightarrow x-r=yq , where r r is the remainder. This means that if a number divided by another one has a remainder, then that number minus the remainder is divisible by the original divisor. If we apply the theorem to our problem, we'd get

p q r s 6361041 r = 1000 q \overline{pqrs\dots 6361041} - r=1000q

Since T 2 S 2 r T^{2}-S^{2} - r needs to be divisible by 1000 1000 , we apply the divisibility rule mentioned above. Consequently, the only way to get the last 3 3 digits of T 2 S 2 T^{2}-S^{2} to be zeros is to have the remainder be 41 41 (since p q r s 6361041 41 = p q r s 6361000 \overline{pqrs\dots 6361041} - 41 = \overline{pqrs\dots 6361000} ), meaning that finally r = 41 r=41 .

Aman Goyal
Aug 26, 2013

last 3 digits of S^2 are 0000 and last 4 digit of T^2 are 1041 so when you subtract S^2 from T^2 , the last 3 digits will be 041..

Yes, but did anyone notice that the result of the subtraction is negative and therefore, result should be -41 or 1000-41, or am I wrong?

Alija Bevrnja - 7 years, 9 months ago

Log in to reply

T = 123 T = 123\dots and S = 100 S = 100\dots , and T T and S S both have the same amount of digits, so it follows that T 2 > S 2 T^2 > S^2 . Also, the question asks for T 2 S 2 T^2 - S^2 , not S 2 T 2 S^2 - T^2 . Also, if the last thee digits of S 2 S^2 had been greater than T 2 T^2 , then the answer would have been 1000 041 = 959 1000 - 041 = 959 , not 000 041 = 41 000 - 041 = -41 .

Josh Petrin - 7 years, 9 months ago

Log in to reply

Well that is what I am talking about, but you have made a mistake, T is not greater than S. Here: "Let T be the number obtained by writing all the numbers from 1 to 100 in reverse order and removing the spaces in between. " This means T=10099989796... which is less than S=12345... (S is more than 20% greater), so T^2 - S^2 is definitely negative

Alija Bevrnja - 7 years, 9 months ago

Log in to reply

@Alija Bevrnja This is exactly the confusion that I wanted to create from this problem, by making T 2 S 2 < 0 T^2 - S^2 < 0 . Consider the following question:

If N N is a negative integer such that N 041 ( m o d 1000 ) N \equiv 041 \pmod{1000} , what is the remainder when N N is divided by 1000?

This helps to test your familiarity with the concept of modular arithmetic.

Calvin Lin Staff - 7 years, 9 months ago

Log in to reply

@Calvin Lin Well, using plain division, remainder would be -959, since N = a * 1000 + (-959), where N, a < 0. But here, we have the case that remainder is -41; so I am a bit confused, why is the answer: 41.

Alija Bevrnja - 7 years, 9 months ago

Log in to reply

@Alija Bevrnja An integer n n , when divided by q q leaves a remainder of r r which satisfies 0 r < q 0 \leq r < q .

959 -959 is not between 0 and 1000.

Calvin Lin Staff - 7 years, 9 months ago

Log in to reply

@Calvin Lin Ok. I confused myself with speedy calculations and conclusions. Thank you for this.

Alija Bevrnja - 7 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...