The input sqrt$(2+O(7^{10}))$ on PARI/GP yields the output:
$ 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + O(7^{10}).$
Which is essentially the solution of the congruence $X^2 \equiv 2 \pmod 7^k $ for $k = 1, 2, 3, \cdots .$
My question is why don't we get the other solution of the congruence as output which is $4+5*7+6*7^2+ \cdots + O(7^{10})$?
The pari/gp documentation for "transcendental functions" is here. (Alternatively, use
??sqrtto get it from the interpreter.)There is a
sqrtfunction for a complex argument documented first, this does not apply here. What applies is the next doc paragraph:So we obtain a result of the shape $3+O(7^1)$ since among the "digits modulo seven" the $3$ is the one $\le 7/2$. Not the $4$.
It is easy to request also the other solution:
The answer is thus just a matter of implementation, and the decision taken this way.