Consider the function $$\tau(n)=\sum_{d|n}1$$ which gives the number of divisors of a number. The question is: How much information does $\tau(n)$ contain about $n$?
The answer is obviously: not very much. There are infinitely many numbers which have the same value for $\tau$. However, if there were an infinite number of equations involving $\tau$ then we would be getting somewhere. For example let us say we are given with the following equations $\tau(n)=\tau(x), \tau(n+1)=\tau(x+1),...,\tau(n+k)=\tau(x+k),...$ and we are asked to find an $x$ satisfying all the above infinite equations for a given $n$. Well $x$ has to be $n$, for $x\neq n$ would imply $\tau$ is periodic. However, let us say that our equations were $\tau(n)=\tau(x), \tau(n+1)=\tau(x+1), \tau(n+4)=\tau(x+4),...,\tau(n+k^2)=\tau(x+k^2)...$ Intuitively, it seems $x=n$, but is there a rigorous way to prove it? What if our equations were $$\tau(n)=\tau(x),\tau(n+a_1)=\tau(x+a_1),...,\tau(n+a_k)=\tau(x+a_k),...$$ where $a_i=p_i$(the $i$th prime) (would $x=n$ be the only solution)? What if $a_i$ is $2^{i}$ or some other positive series that diverges? My question seems to be vague, but if somebody could provide an answer for any of the below cases or provide some resources to read, I will be grateful:
- $a_i=i^2$
- $a_i=p_i$
- $a_i=2^i$
In short: $n$ is uniquely determined by the infinite sequence $$ \tau(n+1^2),\tau(1^2+1),\tau(n+2^2),\tau(n+2^2+1),\tau(n+3^2),\tau(n+3^2+1),\ldots $$ In fact, we don't need to know the exact values of $\tau$ here, only whether they're even or odd.
Note that for any $n\ge 1$, $\tau(n)$ is odd if and only if $n$ is a perfect square. Now suppose we are given a 'mystery integer $n$' and a known integer $k$, and we know that $\tau(n+k^2)$ is odd, then we know that there exists an integer $m$ such that $n=m^2-k^2=(m-k)(m+k)$. In other words, we know that our mystery integer $n$ has a divisor $d:=m+k\mid n$ for which $n/d-d=2k$, so the fact that $\tau(n+k^2)$ is odd gives us some information about $n$. This is what we will exploit.
Let $n\ge 1$ be an integer and define $$ N:=\max\{k\ge 0:k=0\ \vee\ \tau(n+k^2)\equiv 1\pmod 2\}. $$ For any $d\mid n$ with $n/d\equiv d\pmod 2$, we have $N\ge \frac12(n/d-d)$. Therefore, $N=0$ if and only if such a $d$ does not exist, which is the case if and only if, for all $d\mid n$, precisely one of $n/d,d$ is odd and the other is even. This is the case if and only if $n\equiv 2\pmod 4$.
Otherwise, we can ask ourselves what the largest possible value of $k=\frac12(n/d-d)$ is. If $n$ is odd, this is obtained by $d=1$ and we find $N=\frac12(n-1)$. If $4\mid d$, then $d=1$ does not yield an integer value for $k$, but $d=2$ does, and we find $N=\frac14n-1$. Summarizing:
So, while $N$ does give a lot of information about $n$, it is not quite enough to uniquely determine $n$. However, suppose we also define $$ M:=\max\{k\ge 0:k=0\ \vee\ \tau(n+1+k^2)\equiv 1\pmod 2\}. $$ Just like $N$ told us something about $n$, $M$ tells us something about $n+1$ and, by extension, $n$. This is enough to determine $n$:
In conclusion, define an infinite sequence $\{a_{k}\}_{k\ge 1}$ by $a_{2k}=k^2$ and $a_{2k+1}=k^2+1$. Then any $n\ge 1$ is unique determined by $\{\tau(n+a_k)\}_{k\ge 1}$. To retrieve $n$ from this sequence, we first compute $N$ and $M$ by looking at the subsequences $\{\tau(n+a_{2k})\}_{\ge 1}$ and $\{\tau(n+a_{2k+1})\}_{\ge 1}$ respectively. Then, $$ n = \begin{cases} 2N+1\quad&\text{if $N>M$;}\\ 2M&\text{if $M>N$.} \end{cases} $$