Can a number be equal to the sum of the squares of its prime divisors?
If $f(n)=n$ then $p_1^{a_1} \cdot ... \cdot p_k^{a_k}=p_1^2+...+p_k^2$.
From this it follows that $p_1|p_2^2+...+p_k^2$ and that $p_k|p_1^2+...+p_{k-1}^2$, that is, it is true that $p_2^2+...+p_k^2=ap_1$ and $p_1^2+...+p_{k-1}^2=bp_k$ for naturals $a,b$.
If those two equalities are subtracted then it is obtained $p_1^2-p_k^2=bp_k-ap_1$, which is equivalent to $p_1(p_1+a)=p_k(p_k+b)$.
If $p_1$ and $p_k$ are two different primes it follows that $p_1 |(p_k+b)$ and that $p_k|(p_1+a)$, so, there are integers $c$ and $d$ such that $p_k+b=cp_1$ and $p_1+a=dp_k$ and this implies $p_1dp_k=p_kcp_1$, that is $c=d$ and $c>1$.
If equalities $p_k+b=cp_1$ and $p_1+a=cp_k$ are added it is obtained $a+b=(p_1+p_k)(c-1)$.
Now, from $(c-1)(bp_k-ap_1)=(p_1-p_k)(a+b)$ it follows $c=\dfrac{bp_1-ap_k}{bp_k-ap_1}$ and because of $bp_1<bp_k$ and $-ap_k<-ap_1$ it follows $c=\dfrac{bp_1-ap_k}{bp_k-ap_1}<\dfrac{bp_k-ap_1}{bp_k-ap_1}=1$, but this is not possible since $c>1$ so the assumption that $p_1$ and $p_k$ are different primes is false!
That means that necessarily $k=1$ and this settles the question.
Sorry because this isn't a full answer, but I believe that contains sustancials statments that could provide an improve from someone.
Let $d|n$, thus $n=d\cdot n/d$, and by symmetry $\prod_{d|n}d=\prod_{d|n}n/d$, multiply $\prod_{d|n}$ in first identity states $$\left( \prod_{d|n}d\right)^{2}=n^{\sigma_{0}(n)}$$ (this is Exercise 10, page 47 from Apostol, Introduction to Analytic Number Theory), where $\sigma_{0}(n)$ is the number of divisors function. My attempt is extract arithmetic information from this and Euler-Fermat Theorem. The following cases are disjoint with fullness for a collection of primes.
Case 1. We assume without loss of generality that the first prime is $2$, we obtain ($n>1$) $$\left( p_{1}^{2}+p_{2}^{2}+\cdots +p_{\omega (n)}^{2}\right)^{\sigma_{0}(n)}=n^{\sigma_{0}(n)}=\prod_{d|n}d^{2},$$ thus $(0+\omega (n)-1)^{\sigma_{0}(n)}\equiv 0\mod 4$, where $\omega (n)$ is the number of distinct primes, since if $m$ is odd, $m^{2}\equiv 1\mod 4$. These computations removes the cases $\omega(n)$ equals $4\lambda$ or $4\lambda +2$, there are infinitely many subcases.
Case 2. All primes are odd, we obtain with same idea $\omega (n)^{\sigma_{0}(n)}\equiv 1\mod 4$ and discard the same subcases (caution, removes subcases in this case).
Perhaps bounding or using another identities someone can to sweep more cases. I understand that this isn't the full answer, so I accept the response of community, yours or moderators.
It's not a full answer, just remarks
- First
$a_k=1$ (as stated by Awllower)
$a_{k-1} = 1$
$k$ can't be even (obvious)
As stated by Peter $k$ can't be 3, and for the same reason $k$ can't be a multiple of 3, and for the same reason if $k=3x+2$ then 3 can't be a factor of $n$.
- Then
set $x=k$
we have $x*p_k^2>n$
<=> $x*p_k>\prod_{i=1}^{k-1} p_i^{a_i}$
<=> $x*p_k/\prod_{i=1}^{k-2} p_i^{a_i}>p_{k-1}$
so $p_k^2+(k-1)*(x*p_k/\prod_{i=1}^{k-2}p_i^{a_i})^2>n$
<=> $p_k^2*(1+(k-1)*(x/\prod_{i=1}^{k-2}p_i^{a_i})^2)>n$
Now if we try to get the lowest value for $x$, the limite is :
$x=1+(k-1)*(x/\prod_{i=1}^{k-2} p_i^{a_i})^2$
<=> $x={\prod_{i=1}^{k-2}p_i^{a_i}*(\prod_{i=1}^{k-2}p_i^{a_i}-\sqrt{(\prod_{i=1}^{k-2}p_i^{a_i})^2-4(k-1)})\over2(k-1)}$
numerical evaluation of $x$ for $k=5$ and $\prod_{i=1}^{k-2}p_i^{a_i}=2*5*7$ gives $x<1,0008177$
Hope it can help.