Smallest Harshad base

20 Views Asked by At

Let $s_b(n)=$ the sum of the digits of $n$ in base $b$. My question is about the function $f(n): N\rightarrow N =$ smallest $b\ge2$ with $s_b(n)|n$, the smallest base to which $n$ is a Harshad number. (The sequence $a_n=f(n)$ is not in the OEIS.)

Obviously, we have $f(n)\le n$, $f(p)=p$ ($p$ prime) and $f(n^e)\le f(n)$ (e.g. $f(52)=4,f(52^2)=2$).
Also, if we let $a\gt b\in N$, we have $s_a(ab)=s_a(b)=b\rightarrow f(ab)\le a$ and $s_b(ab)=s_b(a)\rightarrow f(af(a))\le f(a)$.

My first question is: Is there existing research regarding this function?

My second question is more specific: Are there any $p$ prime for which $f(p^2)\lt p$ except 5 ($f(25)=3$)?
$b:=f(p^2)\lt p$ implies $s_b(p^2)=p$ and $b-1|n-s_b(n)$ implies $b-1|p(p-1)\rightarrow b-1|p-1$, but I could only show $f(p^2)=p$ for specific $b$ (using the logarithmic upper bound for $s_b(n)$), specific $\frac{p-1}{b-1}$ (shown below) and $p\lt10^9$.

To show that one solution strategy I managed:
Letting $\frac{p-1}{b-1}=2$, $b=\frac{p+1}2$ and $p^2=4b^2-4b+1=3b^2+(b-4)b+1$, so $s_b(p^2)=3+b-4+1=b\lt p$ for $b\ge4\rightarrow p\ge7$. Similar can be done for higher $\frac{p-1}{b-1}$.
I did, however, not find a way to cover the non-excluded primes as $\frac{p-1}{b-1}$ grows larger.