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
3 years, 3 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

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.$$

- 3 years, 3 months ago

By inspection?

- 3 years, 3 months ago

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

- 3 years, 3 months ago

Note edited, sorry.

- 3 years, 3 months ago

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

- 3 years, 3 months ago