Calculating a 2-adic square root of a positive integer of the form a = 8k+1

This returns the first n 2-adic digits x[0],...,x[n-1] of the two 2-adic sqroots of a.
This is a BCMATH translation of a BC program.
Also see lecture notes.

Enter a (non-zero):
Enter n (1000 ≥ n > 0):
Last modified 15th March 2011
Return to main page