First Guess for nth Root

I want to add the PrimeSwing factorial algorithm to my math library, which means I need an nth root function first. The hard part is taking the initial guess. My paper method gets roughly close, but I'm sure there's better.

I want to add an implementation of the PrimeSwing algorithm for computing factorials to my math library, and it requires both prime sieve and square root functions. So, I'm working on add nth root support first. I found this article on Wikipedia on the topic.

The first step is to "take a guess". I'd like suggestions. Presently (on paper) I'm saying that if n is greater than the orders of magnitude in A, then pick a single-digit number. Otherwise, divide A by 10 * (n - 1) and then further divide it by n * highest order digit of A. Ehh. It gets roughly close. I'm sure there's a better solution.

Subscribe to A garage sale for your mind

Don’t miss out on the latest posts. Sign up now to get access to the library of members-only posts.
[email protected]
Subscribe