Define a function $F$ on the natural numbers $\geq 2$ as follows: Start with $a \geq 2$ and let $b$ be the smallest prime divisor of $a$ and $c:=a+b$ and let $d$ denote the largest prime divisor of $c$. Define $F(a):=c-d$. Define the period $p(a)$ of a natural number as $p(a):= \inf \{ i | F^{i}(a)=F^{i-1}(a) \}.$
Here an example:
Let a=832 with smallest prime divisor 2.
Then b=2 and c=834 with largest prime divisor d=139. Then $F(a)$=834-139=695.
Now $a_2=695$ has smallest prime divisor 5 and $c_2=700$ has largest prime divisor 7 and thus $F^2(a)=700-7=693$.
Now $a_3=693$ has smallest prime divisor 3 and $c_3=696$ has largest prime divisor 29 and thus $F^3(a)=696-29=667$.
Now $a_4=667$ has smallest prime divisor 23 and $c_4=690$ has largest prime divisor 23 and thus $F^4(a)=667=F^3(a)$.
Question: Is there an explicit formula for $p(a)$ or a good bound? Has it been considered before?
For integers smaller than or equal to 50000 the largest period was 16 reached at the three numbers 21404, 25515, 25516.
It might also be intersting to look at variations of the function $F$. For example one might take first the largest prime divisor and then the smallest (when starting with a non-prime).