Find the density of a certain subset of $\Bbb N$

84 Views Asked by At

I am trying to determine the density of the set $$ S:=\{\,ap^r-p^s\mid p\text{ prime}, a,r,s\in\Bbb N, 1\le s\le r, 2\le a\le p\,\}.$$ These can also be described as numbers written in base $p$ as an arbitrary digit, followed by zero or more digits $p-1$ (the "nines" of base $p$), followed by one or more zeroes.

The reason I ask about this is that I am trying to investigate a conjecture about a sequence I stumbled over in the OEIS, but that's a different story (in particular, $S$ is not the sequence in question).

What I have so far: I write $S=\bigcup_{r\ge1} S_r$ with $$ S_r:=\{\,ap^r-p^s\mid p\text{ prime}, a,s\in\Bbb N, 1\le s\le r, 2\le a\le p\,\}.$$ I am pretty sure that I managed to show that $\bigcup_{r\ge3} S_r$ has $O(N^{\frac23}\ln^2N)$ elements $<N$, which contributes zero to the density of $S$.

The numbers $\in S_1$ are of the form $ap-p = (a-1)p$, which are precisely the numbers $n$ having a prime factor $>\sqrt n$. Apparently, this implies that $S_1$ has density $\ln 2$.

The numbers in $S_2$ come in two flavours: $$ S_{2,1}:=\{\,ap^2-p\mid p\text{ prime}, a\in\Bbb N, 2\le a\le p\,\}$$ and $$ S_{2,2}:=\{\,ap^2-p^2\mid p\text{ prime}, a\in\Bbb N, 2\le a\le p\,\}.$$ Numbers $n$ in these sets have in common that they have a prime factor $>\sqrt[3]n$ , but as discussed in the above link, it seems that one cannot extend the argument used for $>\sqrt n$ to this case. Also, these are not all numbers with prime factor $>\sqrt[3]n$, so a specific argument may work better.

For $S_{2,2}$, we have a map bijection $S_{2,2}\to S_2$ given by $(a-1)p^2\mapsto (a-1)p$, i.e, "divide by the largest prime factor". It follows easily that this makes the density of $S_{2,2}$ zero: If we ignore the first gazillion terms, the above map increases the density by at least a gazillion, hence we must have started with at most $1/$gazillion.

Remains $S_{2,1}$, numbers of the form $ap^2-p=(ap-1)p$. I had hoped to make an argument similar to that for $S_{2,2}$, but as a larger prime may hide in $ap-1$, or it may even happen that $(ap-1)p=(bq-1)q$, I am unsure ... Perhaps a different argument helps?

1

There are 1 best solutions below

1
On BEST ANSWER

Great job reducing to this last case. If $ap^2 - p < x$ then $p < \sqrt x+1$; for each such prime $p$ there are at most $p-1$ choices of $a$, and so the number of such integers less than $x$ is at most $$ \sum_{p<\sqrt x+1} (p-1) < \sqrt x \cdot \#\{p<\sqrt x+1\} \ll \sqrt x \frac{\sqrt x}{\ln\sqrt x} \ll \frac x{\ln x} $$ (and that's even ignoring potentially counting some integers twice and counting others that exceed $x$), which proves that such numbers have density $0$.