\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}
\title{When is 10101...101 a Prime Number?}
\author{Amit Yaron}
\date{October 16, 2025}
\maketitle
Suppose you have a number whose digits are alternating between 1 and 0 and
you want to determine if it is a prime number. For example, 101010101.
How do you find if the number is prime or composite?\\
To find it, let us create a sequence of such numbers:
\[
  a_n=\sum\limits_{k=0}\limits^k 100^k
\]
So,
\[
  a_1=101,\ a_2=10101,\ a_3=1010101,\ldots
\]
Now, the only factors of a prime number are 1 and the number itself. Let us
express $a_n$ in a form one can factorize, to do so let us find $a_{n+1}$ for
a given non-negative integer $n$. It can be expressed two ways:
\[
  a_{n+1}=100a_n+1
\]
and
\[
  a_{n+1}=a_n+100^{n+1}
\]
From both, you can find that:
\[
  100a_n+1=a_n+100^{n+1}\Rightarrow 99a_n=100^{n+1}-1\Rightarrow a_n=\frac{100^{n+1}-1}{99}
\]
For convenience, let $m=n+1$. Now, what is $100$?
\[
  100=10^2
\]
And, from the power rule:
\[
  {(a^b)}^c = a^{bc}={(a^c)}^b
\]
Great!
Now,
\[
  a_n=a_{m-1}=\frac{100^m-1}{99}=\frac{{(10^2)}^m-1}{99}=\frac{{(10^m)}^2-1}{99}
\]
And another identity is:
\[
  x^2-y^2=(x-y)(x+y)
\]
Thus,
\[
  a_{m-1}=\frac{{(10^m)}^2-1^2}{99}=\frac{(10^m-1)(10^m+1)}{9\cdot11}
\]
Now, for any non-negative integer $m$, $10^m-1$ is divisible by 9.
If $m$ is odd, then $10^m+1$ is divisible by 11. and if $m$ is even, then
$10^m-1$ is divisible by 11.
Let us split into cases:
\section*{$m$ is odd}
Then,
\[
  a_{m-1}=\frac{10^m-1}9\cdot\frac{10^m+1}{11}
\]
Which of the factors is $1$?\\
if $\frac{10^m-1}9=1$, then
\[
  10^m-1=9\Rightarrow 10^m=10\Rightarrow m=1\Rightarrow 10^m+1=11
\]
Both factors are $1$.
Thus,
\[
  a_{m-1}=1
\]
Not a prime.
\section*{$m$ is even}
Then,
\[
  a_{m-1}=\frac{10^m-1}{99}(10^m+1)
\]
and $10^m+1=1\Rightarrow 10^m=0$, thus if $a_{m-1}$ is prime, then:
\[
  \frac{10^m-1}{99}=1\Rightarrow 10^m-1=99\Rightarrow 10^m=100=10^2\Rightarrow m=2
\]
Which means that
\[
  a_{m-1}=a_1=\frac{100^2-1}{99}=\frac{10000-1}{99}=\frac{9999}{99}=101
\]
\section*{Conclusion}
Thus, the only prime number in our sequence is 101

\end{document}
