Does r=uint64(308436464205151562) make sense? It seems like the argument to uint64 is a double precision number, so you have already lost the precision you are trying to gain by using uint64.
r=uint64(308436464205151562) outputs for uint64(r) 308436464205151562. However, r=308436464205151562 outputs for uint64(r) 308436464205151552. A very small loss in precision, but still a loss. The Challenge set has some numbers that use all the paint if full precision math was used. If residual paint was required as an output then full precision is needed. For solutions using p=p-2*r-1 the errors in r and p may cause issues.
Very novel input parameter adjustment to allow direct solution.
That's Muller's method which is more computationally realiable than Bhaskaracharya's.
Nice bisecting search method and anonymous function for clean appearance.
Convert hex color specification to MATLAB RGB
147 Solvers
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
147 Solvers
Get the elements of diagonal and antidiagonal for any m-by-n matrix
296 Solvers
Detect a number and replace with two NaN's
180 Solvers
128 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!