What two prime numbers are never a factor of n n 9s

A number of the form 1 0 n 1 = 9999...9 n times , 10^n-1=\underbrace{9999...9}_{n\text{ times}}, where n n is a positive integer, will never be divisible by 2 2 or 5. 5.

Are there any other prime numbers that numbers of this form are never divisible by ?

Yes No

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.

8 solutions

Kelvin Hong
Sep 16, 2018

Let's use the Pigeonhole Theorem to solve this.

Assume p 2 , 5 p\neq2,5 is a prime, then consider a series:

9 , 99 , 999 , , 999...99 p + 1 times 9,99,999,\dots,\underbrace{999...99}_{p+1\text{ times}}

We can always find two numbers congruent under modulo p p , say that is 999...99 a times 999...99 b times ( m o d p ) \underbrace{999...99}_{a\text{ times}}\equiv \underbrace{999...99}_{b\text{ times}}\pmod{p}

WLOG, assume a > b a>b , then we have 999...99 a times 999...99 b times 0 ( m o d p ) \underbrace{999...99}_{a\text{ times}}-\underbrace{999...99}_{b\text{ times}}\equiv0 \pmod p

So this number, which has ( a b ) (a-b) 9 9 's in front and followed by b b 0 0 's, is divisible by p p , but since p p is not equal to 2 , 5 2,5 , then we can cancel all of the zeros behind 9 9 's, so 999...99 ( a b ) times = 1 0 a b 1 \underbrace{999...99}_{(a-b)\text{ times}}=10^{a-b}-1 will be the multiple of p p , hence proved.

What about a prime number infinitely close to infinity?

Little Narwhal - 2 years, 8 months ago

Log in to reply

Infinity is always infinitely far away.

Jonathan Birk - 2 years, 8 months ago

A prime number infinitely close to infinity is also infinitely far from infinity, so every prime fits this definition.

Owen Jones - 2 years, 8 months ago

The correct answer is yes. As the problem is stated, primes larger than 10^n - 1 are not excluded.

Tom Hammer - 2 years, 8 months ago

Log in to reply

Yes, but there's no prime p larger than all possible 10^n - 1, which is what the problem states.

Arthur Frisk - 2 years, 8 months ago

Why there must be two of them being congruent under modulo p?

ChengYiin Ong - 2 years, 8 months ago

Log in to reply

Yes, please, explain or point to some other resource

Anton Curmanschiy - 2 years, 8 months ago

Log in to reply

Because you have p+1 integers, and there are exactly p integers modulo p. So 2 must be congruent by the pigeon hole principle https://en.m.wikipedia.org/wiki/Pigeonhole_principle

Daniel Uteda - 2 years, 8 months ago

There are exactly p congruence classes modulo p. For instance, if p=7, these congruence classes can be denoted by 0,1,2,3,4,5,6. If I give you p+1 integers, then, obviously, at least 2 of them have to belong to the same congruence class because there are only p "pigeon holes" (=congruence classes) to put the p+1 "pigeons" (=integers) in to, so at least one "pigeon hole" contains at least 2 integers.

Pieter odb - 2 years, 8 months ago

What goes wrong here if p =2 or 5?

Daniel Uteda - 2 years, 8 months ago

Log in to reply

All of the number end in 9 and so they are never divisible by 2 or 5

Anton Curmanschiy - 2 years, 8 months ago

When we subtract 10^b-1 from 10^a-1, we get a number of the form 99..9900..00, which must be a multiple of p. When p is neither 2 nor 5, the final zeroes can be removed.

Michael Schmahl - 2 years, 8 months ago

Great solution, one of those times number theory shows its beauty, thanks! Small suggestion: you don't have to use contradiction since you don't use the initial assumption anywhere in the proof. "Let prime p != 2, 5 ... <proof> ... 10^{a-b} - 1 will be multiple of p" is a tad cleaner.

Orfeas Thyfronitis - 2 years, 8 months ago

Log in to reply

Thanks! Not realize of it, I think I should change my habit....

Kelvin Hong - 2 years, 8 months ago

Why must 2 of them be congruent under modulo p?

Yuelong Chen - 2 years, 8 months ago

Log in to reply

Let's say p = 7 p=7 , then the series we take is 9 , 99 , 999 , 9999 , 99999 , 999999 , 9999999 , 99999999 9,99,999,9999,99999,999999,9999999,99999999 , use these eight numbers divided by 7 7 , you will get eight numbers which is varies between 0 0 to 6 6 only, two of them must be the same.

Kelvin Hong - 2 years, 8 months ago

What is happening? I chose 'no' but then it saysd I viewed the solution!

Brilliant staff, help!

Long Plays - 2 years, 8 months ago

I don’t understand “but since p is not equal to 2,5 then we cancel all of the zeroed behind 9’s”

Marcus Handley - 2 years, 8 months ago

Log in to reply

If the number is 99...999000...00 99...999000...00 , the number is equal to 99...999 × 1 0 b 99...999 \times 10^b . This number must be divisible by p p , but the prime factors of 1 0 b 10^b are just 2 2 and 5 5 . Since we already said p p is not 2 2 or 5 5 , we can "cancel out" the 1 0 b 10^b and focus on the 99...999 99...999 part which must be divisible by p p to make the whole number divisible by p p .

Zain Majumder - 2 years, 8 months ago

The numbers of those form are never divisible by 7 I think

Kumar Patchakanthala - 2 years, 8 months ago

Log in to reply

We can find a number divisible by 7 7 . The argument implies the answer must be less than 1 0 8 1 10^8-1 , and testing shows 1 0 6 1 7 = 142857 \frac{10^6-1}{7}=142857 .

Zain Majumder - 2 years, 8 months ago

So answer must be YES right

Kumar Patchakanthala - 2 years, 8 months ago

Log in to reply

No. The answer would be YES if there isn't a value in the form 1 0 n 1 10^n-1 which is divisible by p p , but there always is, so the answer is NO.

Zain Majumder - 2 years, 8 months ago
Brian Moehring
Sep 6, 2018

By Fermat's Little Theorem , if p p is a prime that doesn't divide 10 , 10, then p divides 1 0 p 1 1 p \text{ divides } 10^{p-1} - 1


Remark: The problem has changed both in problem text and answer type since I posted this solution. The previous sentence is actually the complete solution for the current form (as a "featured problem"). I've left the rest of my solution below unedited, but it is unnecessary for the current form.

This covers all primes other than 2 , 5. 2, 5. For these two primes p { 2 , 5 } , p \in \{2,5\}, we note that the p p divides 1 0 n 10^n (since n 1 n\geq 1 ), so p divides 1 0 n 1 p divides 1 p \text{ divides } 10^n-1 \iff p \text{ divides } -1 but since no prime divides 1 , -1, we conclude neither 2 2 nor 5 5 is a factor of 1 0 n 1 10^n - 1 for any n 1. n \geq 1.

Their product, and therefore the answer to the problem, is 2 × 5 = 10 2\times 5 = \boxed{10}

(gonna go post a problem about this...)

Michael Mendrin - 2 years, 8 months ago
Binky Mh
Sep 16, 2018

The last digit of any prime (other than 2 2 or 5 5 ) will cycle through all ten digits in some order repeatedly, with every tenth ending number being 0 0 .

This means we can take any number x n x_n , add to it q × p q\times p where p p is the prime in question and q q is a positive integer less than 10 10 , and produce a number such that x n + p q = 10 x n + 1 + 9 x_n+pq=10x_{n+1} + 9

For example, where p = 97 p=97 : 679 + 97 × 60 = 6499 679+97\times60=6499 6499 + 97 × 500 = 54999 6499+97\times500=54999

In these cases, x 1 = 67 x_1=67 , x 2 = 64 x_2=64 , x 3 = 54 x_3=54 .

Let's assume there is some prime number which causes the value of x x to loop, and so would never produce a number 1 0 y 1 10^y-1 with this method:

Such a loop would produce the situation x + p Q = 1 0 y x + 1 0 y 1 x+pQ=10^yx+10^y-1 , where Q Q is the sum of all q q within a loop, and y y is some amount of 9 9 s. (e.g. 13 + p Q = 139...999 13+pQ=139...999 )

However, as x x must be a multiple of p p , we know that x + p Q x+pQ is a multiple of p p , as is 1 0 y x 10^yx . For the equation to balance, 1 0 y 1 10^y-1 must also be a multiple of p p , and thus, even if a prime number loops using this method, it will still be a divisor of a number with the form 1 0 y 1 10^y-1 .

Why would x have to be odd? Take p=41, q=9, then x=36...

C . - 2 years, 8 months ago

Log in to reply

You need to make x odd in order to continue producing 9s. you can't multiply 36 by an integer to end it in 9, so 9 is not a viable value for q in that situation. Instead, 19 would be used: p=41, q=19, x=77.

Binky MH - 2 years, 8 months ago

Log in to reply

Right. So you're saying for any "odd number not ending in 5" there would exist a multiplicand (q) that would give an odd x... And i suppose that x would also need to not end in 5.

Well, if this can be proven, that's one less drawback... Good luck. :-)

C . - 2 years, 8 months ago

But how can numbers of 999...9 (n times) form be divisible be 7?

Anisha Jain - 2 years, 8 months ago

Log in to reply

999999 = 7 * 142857 (and 999999999999 = 7 * 142857142857, etc)... Because 7 divides 111111. ;-)

Also, this can be seen from the fact that dividing by 7 can give rational numbers with recurring decimals, and the length of the repeated portion is 6: 1 7 = 0.14285714285714... \frac{1}7=0.14285714285714... Expressing this equality in equivalent terms, we get 1 7 = 142857 999999 \frac{1}7=\frac{142857}{999999} so 999999=7*142857.

C . - 2 years, 8 months ago

Log in to reply

So, what is the answer to any 10 ^n - 1 divided by 7? Or, what number with all 9's can be divided by 7? Your theory may be mathematically correct, but not functionally correct.

Norm Worthy - 2 years, 8 months ago

Log in to reply

@Norm Worthy Oh Bother, when n=13 it works, Darn.

Norm Worthy - 2 years, 8 months ago

Log in to reply

@Norm Worthy Make that n=12.
10^12 - 1 = 999999999
(10^12 - 1) / 7 = 142857142857

Norm Worthy - 2 years, 8 months ago

Log in to reply

@Norm Worthy Well... yeah. Did you miss the first line of my reply? I showed that n=6 and n=12 both work. :-)

C . - 2 years, 8 months ago

Okay I have no idea what I was thinking when I wrote this because this makes no sense.

Binky MH - 2 years, 8 months ago

Log in to reply

Heh, well it makes a little bit of sense, trying to go for an induction solution... A nice approach, but i'm not sure it can really work, due to 2 reasons : the next step might have (as i said in my 1st comment) an even number, which can never be a factor of some 9-only number ; and i think this process doesn't necessarily get smaller numbers for later steps, which would be pretty much a requirement for being able to use an inductive reasoning. :-|

C . - 2 years, 8 months ago

I figured out what I was thinking, so I've rewritten this to actually make sense.

Binky MH - 2 years, 7 months ago

It's much easier than it seems.

When you factorize 10 into prime numbers you get 5 × 2 5 \times 2 . If you raise 10 to the nth power and you factorize it too, you get 5 n × 2 n 5^n \times 2^n .

However, we are subtracting 1 from 1 0 n 10 ^n . This means, that we are only 1 unit away to be able to factorize the number by 2. Similarly, we are only 1 unit away to be able to factorize the number by 5. However, the number isn't away a fixed number from being able to be divisible by any other number different to 2 and 5.

So 1 0 n 10^n isn't divisible FOR SURE for both 2 and 5. Therefore, 1 0 n 10^n might be divisible by any other prime number.

Your last line needs 10^n - 1 where you've typed 10^n.

Richard Desper - 2 years, 8 months ago
Artem Gusev
Sep 18, 2018

Roses are red,

Violets are blue,

Let's say "yes" is false

And therefore "no" is true

:)

Richard Farrer
Sep 18, 2018

Consider 1 / p 1/p for prime p 2 , 5 p \neq 2, 5 . The decimal expansion of this repeats after n digits for some integer n since all rational fractions have a repeating decimal expansion.

Thus 1 0 n 1 / p 1 / p 10^n * 1/p - 1/p is an integer so p divides 1 0 n 1 10^n - 1 .

We can go further using Fermat's little theorem to show n = p-1 is one possible value but other people have discussed this already.

N nhhhnnmnhnnhnnjn

Carl Alexis - 2 years, 8 months ago

To be divisible by 2 last digit should be multiple of 2.

Hence, 2 cannot divide (10^n-1)

To be divisible by 5 last digit should be 5.

Hence, 5 cannot divide (10^n-1)

Product of 2 numbers = 2 " 5 = 10

Nice solution, however, you applied the wrong operator to the two numbers, I asked for the product!

Mike Pannekoek - 2 years, 9 months ago

Log in to reply

also, part of the solution that I would like to see is proof of why there are no other numbers

Mike Pannekoek - 2 years, 9 months ago
Henrik Rueping
Sep 21, 2018

Given a prime number p p different from 2 and 5. We want to find a solution to 10^{n-1} =0 /) (mod p) or \(10^n =1 (mod p). Since p is coprime to 10, we know that 10 is not zero mod p. By Fermats little theorem we have 1 0 p 1 = 1 10^{p-1}= 1 (mod p).

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...