Same Digit in All Place Values

Algebra Level 4

Let n n be an integer that has the same digit appearing in all of its place values.

22 , 666 , 77777 , 333333333 , . . . 22, 666, 77777, 333333333, ...

What is the smallest value of n n such that it is divisible by all digits except for 5 5 and 0 0 ?


Try a similar problem!


The answer is 888888888888888888.

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.

3 solutions

Chris Lewis
Oct 5, 2020

Let n n have k k digits, all equal to d d .

For 8 8 to divide n n , we need 8 8 to divide the last three digits of n n , that is d d d = d 111 \overline{ddd}=d \cdot 111 . The only possibility is d = 8 d=8 .

For 9 9 to divide n n , we need 9 9 to divide the sum of digits of n n , that is 8 k 8k ; since gcd ( 8 , 9 ) = 1 \gcd(8,9)=1 , this means 9 9 divides k k .

For 7 7 to divide n n , we need 6 6 to divide k k . This is because 7 7 divides 1001 1001 , so 7 7 divides 111111 111111 .

Note that these three divisors are enough; for instance, if both 8 8 and 9 9 divide n n , then 6 6 does too, and so on.

The smallest k k that works is 18 18 ; so the smallest n n is a string of eighteen 8 8 s, that is n = 888888888888888888 n=\boxed{888888888888888888} .

This n n is also divisible by 11 , 12 , 13 11,12,13 and 14 14 .

Chris Lewis - 8 months, 1 week ago

Because you used divisibility rule for 8 in your solution like this you should discard case when the number n has less than 3 digits. Of course it does not have 1 or 2 digits, because number d would have to be divisible by 9,8,7 simultaneously and this is clearly impossible (d is less than 10 and smallest such number is 504), but still you should put it into your solution.

Dan Czinege - 8 months ago
Arindam Ghosh
Nov 12, 2020

As every digit is same of the number, and the number is divisible by 8, we can say the number is 88888... upto some n digits.. So I use brute force to find the n or the length of the number..

1
2
3
4
for i in range(1,20):
        n = int("8"*i)
        if n%7 == 0 and n%9 == 0:
            print(i)

1
18

Mehdi K.
Oct 13, 2020

[Hello, this is not a complete solution :) ]

Related Topics: converting repeating decimal into a fraction and multiplicative order.

To generalize the solution

Let N be a same-digit-repeating-integer, and k k is the least common multiple of all given divisors of N. The prime factorization of k k is 2 a 0 . 3 a 1 . 5 0 . 7 a 3 . . . p z a z , ( a 0 < 4 ) 2^{a_0}.3^{a_1}.5^{0}.7^{a_3}...p_z^{a_z}, (a_0<4) . Let 2 a 0 = s 2^{a_0}= s

If s = 4 o r 8 s= 4 or 8 then N = s × 1 0 l c m ( O ( 10 , k s ) , 3 a 1 ) 1 9 \displaystyle N = s \times \frac{10^{lcm( O( 10, \frac{k}{s}), 3^{a_1})} -1 }{9} .

O ( a , b ) O(a,b) returns the multiplicative order of a m o d b a \mod b

So here we have k = l c m ( 1 , 2 , 3 , 4 , 6 , 7 , 8 , 9 ) = 2 3 × 3 2 × 7 = 504 ; s = 2 3 = 8 ; O ( 10 , 504 8 ) = 6 k= lcm(1, 2, 3, 4, 6, 7, 8, 9)= 2^3 \times 3^2 \times 7= 504; s=2^3=8; O(10, \frac{504}{8})= 6

So N = 8 × 1 0 18 1 9 = 888888888888888888 N=8 \times \frac{ 10^{18} -1}{9}= 888888888888888888

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...