23

For integers $n$, the arithmetic derivative $D(n)$ is defined as follows:

  • $D(p) = 1$, for any prime $p$.
  • $D(mn) = D(m)n + mD(n)$, for any $m,n\in\mathbb{N}$ (Leibniz rule).
  • $D(-n) = -D(n)$.

The Leibniz rule implies that $D(0) = 0$ and $D(1) = 0$.

Now consider over $\mathbb{N}$ the iteration of the function $$f(x)=x-D(x)+1.$$

The only possible fixed points $C$ of the sequence $x_n=f(x_{n-1})$ satisfy $$C=C-D(C)+1$$ that is $$D(C)=1.$$ Therefore, $C$ is a prime number. My experiments show that the sequence always converges to a prime number.

Just a few examples: $$56→−35→−22→−8→5$$ $$170105→122935→92889→30955→23805→1105→735→134→66→6→2$$ How to prove it rigorously?

Here is the top ten of attractors (so far to $2\cdot10^5$):

prime count frequency
$2$ $68264$ $0.341320$
$5$ $44566$ $0.222830$
$17$ $8246$ $0.041230$
$29$ $5083$ $0.025415$
$97$ $2850$ $0.014250$
$37$ $2351$ $0.011755$
$271$ $1822$ $0.009110$
$193$ $1631$ $0.008155$
$181$ $1443$ $0.007215$
$73$ $1181$ $0.005905$

How to explain the previous frequencies?

Many thanks.


Addendum 1

A natural extention of the function could be $$g(x)=x-D(x)+sgn(x).$$ In this case, one can work along $\mathbb{Z}$ and the attractors become $$A=\{0\}∪\{p,−p : p\,\,prime\}.$$ Naturally, the spectrum of the attractors changes. In particular, $p$ and $-p$ will have the same relative frequency. In the testing range $[-10^5,10^5]$, the fixed point $0$ reaches the $13$-th place, with $773$ occurrences. The condition to reach $0$ is simple: $D(n)=n+1$; for example, $D(30)=31$.


Addendum 2

Another similar function is $$f(x)=x-2D(x)+2,$$ for which one has $$f(2m)=2m-2D(2m)+2=2m-2(m+2D(m))+2=2-4D(m),$$ that is always even; therefore, the basin of attraction of the prime $2$ is exactly the $50\%$.

  • 3
    Note that if $n=\Pi p_k^{a_k}$ then $\frac{D(n)}{n}=\sum \frac{a_k}{p_k}$ so $D(n)/n$ can be arbitrarily large (in the sense that it can be $\approx \log n$), hence $|f(n)|$ can be very large compared to $n$ so the question is an arithmetical one, namely is $f(n)$ generally forced to have (few) prime divisors at small powers (at least after some iterations), so it's probably quite hard – Conrad Nov 12 '25 at 23:14
  • The iteration can lead to a significantly larger number, for example it reaches 20746241 from 1483008, 13852609 from 418176, 3373057 from 314368. I am not sure which of 211, 73 is more frequent. – mezzoctane Nov 13 '25 at 07:41
  • 2
    (cont.) According to my script, all positive integers below $16{,}777{,}216$ produce eventually constant sequences. Iteration from $15{,}993{,}856=2^{10}\cdot 15619$ reaches $745{,}509{,}953$ (ratio $\approx 46.612$): $$15993856 \to -63976447 \to -61951135 \to -47597952 \to 134861249 \to 134729664 \to -317510719 \to -317510717 \to -276114560 \to 745509953$$ Most frequent endpoints 2 (5M), 5 (4M), 17 (531K), 29 (306K), 97 (177K), 37 (151K), 271 (125K), 193 (106K), 181 (87K), 211 (70K), 73 (67K), 41 (62K), 449 (62K), 113 (50K), 101 (49K), 349 (49K), 61 (44K), 433 (41K), 1259 (40K), 661 (34K) – mezzoctane Nov 13 '25 at 10:34
  • The odd endpoints are much more likely to be $1$ than $3$, $\pmod 4 $. – René Gy Nov 13 '25 at 20:15
  • 1
    I verified $f(x) = x - D(x) + 1$ for all sequences that start in [0, 933852480] and stay in the interval [-933852480, 933852480]. I figured the chance of the sequence hitting a +ve prime before it hits any of the earlier values is in general far greater, but I'm yet to be convinced that there are no counterexamples with cycles of length > 1. Maybe I'll try a more ambitious search at some point. – Simon Goater Nov 15 '25 at 12:48
  • 3
    Your function g(x) has non-trivial cycles. e.g. (792, -995, -792, 995) – Simon Goater Dec 10 '25 at 12:08

0 Answers0