# Pattern of Numbers

Why is it that $$7 = 10-3$$ $$77 = 10^2-23$$ $$777 = 10^3- 223$$ It seems that $3,23,223, \dots$ are all prime numbers. Is there any special reason for this?

-
the strong law of small numbers – pedja Nov 19 '11 at 3:14

Primality testing for the first 1000 elements using Mathematica:

Tally[PrimeQ/@Table[ToExpression@StringJoin[{Array["2" &, {i}], {"3"}}],
{i, 0, 1000}]]

{{True, 13}, {False, 987}}


The number of digits of those primes are:

{1, 2, 3, 8, 11, 36, 95, 101, 128, 260, 351, 467, 645}


Edit

Primes get sparse as you go on. For the first 2000 elements:

{{True, 16}, {False, 1984}}


The number of digits of those primes are:

{1, 2, 3, 8, 11, 36, 95, 101, 128, 260, 351, 467, 645, 1011, 1178, 1217}


Plotting occurrence number vs. number of digits on a Log scale:

ListLogPlot[Flatten@Position[b, True], InterpolationOrder -> 3,
Joined -> True, Mesh -> Full]


-
Wow, I got eleven out of thirteen? :D – J. M. Nov 19 '11 at 16:15

No. $7777=10^4-2223$, and $2223=3\cdot 741$ is not prime. More generally, $$10^n=\underset{n}{\underbrace{7\dots 7}}+\underset{n-1}{\underbrace{2\dots 2}}3\;,$$ and if $n-1$ is a multiple of $3$, then $$\underset{n-1}{\underbrace{2\dots 2}}3$$ is guaranteed to be a multiple of $3$. Thus, $$\underset{n-1}{\underbrace{2\dots 2}}3$$ is composite for $n=4,7,10,13,\dots$.

-
For $n \leq 400$, the only prime values are $n=1, 2, 3, 8, 11, 36, 95, 101, 128, 260, 351, \dots$; not that many primes, I'd say. – J. M. Nov 19 '11 at 3:05