###### Waste less time on Facebook — follow Brilliant.
×

There is a sequence of numbers: $$7,97,997,9997,99997,999997 ......$$ Find the tenth term of this number which is not a prime.

Note by Bryan Lee Shi Yang
2 years ago

Sort by:

Since it is obviously not an infinite sequence of primes, it should be fastest to check the first few terms.

$9997 = 13\times 769$

Edit 1: By Fermat's Little Theorem, if $$9997$$ is prime, then $2^{9997} \equiv 2\ (\text{mod } 9997).$ But $2^{9997} \text{ mod } 9997 = 8192.$ You can check this with an exponential expansion of $$2^{9997},$$ or with Euler's theorem; both are tedious. In the words of Fermat himself, I would provide the proof, if I were not afraid to be too long.

Edit 2: the note now asks for the tenth composite in the sequence; I have a Java solution which shows it to be $$9999999999997$$ (term $$13$$, implying there are at least $$9$$ more consecutive composites after the first) but proving this seems extremely tedious as I am only familiar with FLT and Euler's theorem. Does anyone have an idea? I know there is at least one more prime in the sequence, for example term $$17.$$ · 2 years ago

By inspection? · 2 years ago

Yes, it is by far the fastest way to solve this problem, but I have added a FLT solution. · 2 years ago

Note edited, sorry. · 2 years ago

Eg if 999999....999997 (n 9's) is the first term which is not a prime factor, then that term is $$n+1$$. · 2 years ago