I got a nice problem.
Let $n$ be a natural number and $1=d_1<d_2<\dots<d_k=n$ be the positive divisors of $n$. Now, find minimum $n$ such that $2n=d_5^2+d_6^2-1$.
I proceeded as follows.
Conclusions: The only possibility is $p=2$ and $q=2^4+1=17$. Hence $n=2^4\cdot 17=272$.
Although I have verified, I would like to know if any elegant or shorter solution is there, by that I mean, I am not sure whether this is the smallest number.
I assumed some things right in the beginning, and that is why it is a little unelegant.
I would like to know if there is any better approach to this problem.
Thanks in advance!

Yes, your result is correct and by brute force I confirm that $n=272=2^4\cdot 17$ is the minimum. Your proof is fine to me and it is also elegant. Actually it seems to me that you proved that $272$ is the only possible solution of $2n=d_5^2+d_6^2-1$ and therefore it is the minimum one.