Inspired by Dhruv Bhasin

Logic Level 3

A positive integer is said to be trams if it is divisible by the number formed by its first two digits.

For example, 100 is trams as 10 100 10 \mid 100 .

Find the sum of the first 5 trams numbers, which have the first two digits equal to 17.


Inspiration


The answer is 5338.

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.

1 solution

Arulx Z
Nov 6, 2015

We can rewrite this as

f ( n ) = 17 1 0 n + x f\left( n \right) = 17\cdot10^n+x

for some integer x x . Since 17 ( 17 1 0 n + x ) 17|\left( 17\cdot 10^{ n } +x \right) and 17 17 1 0 n 17|17\cdot 10^{ n } , it implies that 17 x 17|x . Additionally since the first 2 digits need to be 17, x x needs to be smaller than 1 0 n 2 10^{n-2} .

Since we want the tram numbers as small as possible, we try to keep the value of n n as small as possible. After that, we test different small values of x x based on above restrictions to find out tram numbers.

For n = 0 n = 0 , we have f ( n ) = 17 + x f\left( n \right) = 17 + x . Only possible value of x x satisfying the restrictions is 0.

For n = 1 n = 1 , we have f ( n ) = 170 + x f\left( n \right) = 170 + x . Again only possible value of x x satisfying the restrictions is 0.

For n = 2 n = 2 , we have f ( n ) = 1700 + x f\left( n \right) = 1700 + x . Now x x can take the values of 0, 17 and 34.

So the smallest 5 tram numbers are 17, 170, 1700, 1717 and 1734. Sum of them is 5338.

Moderator note:

Good observations. Being able to work comfortably in modulus helps us clearly express our thoughts for such divisibility questions.

You should clarify that "the restriction" is the number of digits in x x . In particular, x < 1 0 n x < 10 ^ n . Otherwise, we would have 17 × 1 0 1 + 17 17 \times 10 ^1 + 17 as an answer.

Calvin Lin Staff - 5 years, 7 months ago

Log in to reply

I have modified the answer. Please check it.

Arulx Z - 5 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...