A long time back, I wondered what functions other than integer polynomials on $\mathbb{N}$ (or $\mathbb{Z}$) satisfied the property:
$\forall m,n: \left(m-n\right) \mid \left(f(m)-f(n)\right)$
Turns out that, on $\mathbb{N}$, you can categorize all such functions, using Chinese remainder theorem, as:
$f(n)=\sum_{k=0}^{\infty}a_k \operatorname{lcm}[k] {n \choose k}$
Where $\operatorname{lcm}[k]$ is the least common multiple of $\{1,2,...,k\}$ and the $a_k$ are arbitrary integers. (In particular, there are thus uncountably many of them.)
On $\mathbb{Z}$ a similar 'basis' can be found.
It then occurred to me that really, if we have any set $S\subset\mathbb{Z}$ we can define the set of functions $f:S\rightarrow \mathbb{Z}$ with this property, and that if $S$ is infinite (or if $|S|=1$) then the ring of such functions is an integral domain.
In fact, we can define a small category, with objects equal to non-empty subsets of $\mathbb{Z}$ and with morphisms any functions from one set to the other with this property. Then the ring which we defined above is really just $\operatorname{Hom}(S,\mathbb{Z})$ in this category.
- If $S$ is infinite, then $\operatorname{Hom}(S,\mathbb{Z})$ contains a sub-ring isomorphic to $\mathbb{Z}[x]$.
- If $S$ is infinite, the image of $S$ under such a function is either infinite or a set of size $1$, therefore we could just look at the sub-category of sets $S$ which are infinite or singletons, and then, in that case, the ring of functions from $S$ is always an integral domain.
- $\operatorname{Hom}(S,\mathbb{Z})$ is a covariant functor from this category to the category of rings.
- When $S_1 \subset S_2$, and $S_1$ is infinite, then the corresponding ring homomorphism is 1-1, but rarely (if ever) onto. This makes this category different than if we had just defined it in terms of integer polynomial functions only.
So, what are these functions? They clearly are functions which have nice $p$-adic proerties for all $p$, but I don't really know what else can be said about them, or about this category, or about these rings.
Edit: For example, are there cases where the rings corresponding to infinite sets $S$ and $T$ are isomorphic, but where the two sets are not translations or reflections of each other?
Edit: So, if you can extend all such functions from $\mathbb{Z}-\{0\}$ to $\mathbb{Z}$, it turns out you can extend any such function on $\mathbb{N}^+$ to $\mathbb{N}$, and then in turn you can extend any function on $\mathbb{N}$ to all of $Z$.
Proof: Assume we can extend any such function on $\mathbb{Z}-\{0\}$ to $\mathbb{Z}$. Let $f$ be such a function on $\mathbb{N}^+$, and define $g(n)=f(n^2)$ on $\mathbb{Z}-\{0\}$. Then $g(0)$ can be defined so that $g(n)-g(0)=f(n^2)-g(0)$ is divisible by $n$ for all $n$. Then for positive integers $n$, $f(n^2)-f(n)$ is divisible by $n$. And $f(n^2)-g(0)$ is divisible by $n$, so $f(n)-g(0)$ is divisible by $n$, so we can extend $f$ to $\mathbb{N}$ by setting $f(0)=g(0)$.
One way to think of these functions it to think of them as being continuous as $p$-adic for all primes $p$. In particular, then, if we are able to find an extension of $f$ on $\mathbb{N}^+$ to $\mathbb{N}$, then for each $p$, the $p$-adic limit, $\lim_{k\rightarrow \infty} f(p^k)$, must converge to a rational integer.
Resolution of the extension question:
Let $f(n) = \sum a_m (n)_m$ where $(x)_m$ is the falling factorial, $(x)_m = m! {x \choose m}$
This defines a suitable $f$ on $\mathbb{N}$. We will find suitable $\{a_m\}$ such that the $f(-1)$ cannot be defined as a rational integer so that it satisfies the condition.
Now, if we just naively tried to put $-1$ into the formula for $f(n)$, we'd see that $(-1)_m = (-1)^m {m!}$
But the nature of our condition on functions is that they are continuous as $p$-adic functions for all $p$. So, if there is an extension of $f$ to $-1$, it can be found by taking p-adic limits. In particular, we can see that in $p$-adic numbers, for all $p$, the "naive" sum must converge to our value $f(-1)$ in p-adic values:
$f(-1) = \sum (-1)^m a_m {m!}$
So, we are going to find $\{a_m\}$ such that the right hand sum is $(p-1)/2 \pmod p$ for all $p$. Then the sum cannot converge to an integer value.
We will set $a_m=0$ when $m+1$ is not an odd prime prime.
Now, $\mod p$, the sum only depends on terms $a_m$ with $m . For each prime $p$, we can always find a $a_{p-1}$ such that $a_{p-1}(-1)^{p-1} (p-1)! + \sum (\text{previous terms})$ is $\frac{p-1}{2} \pmod p.$ None of the terms later will affect this fact, so we have that $f(-1) \equiv \frac{p-1}{2} \pmod p$ for all $p$. But then $f(-1)$ cannot be a rational integer. Edit: Closing with my answer below. I've explored these functions some more here.