Interesting. I've solved several more puzzles in the Community group after this one, but I still can't see your solution, Binbin. It's obviously much smaller than mine is, which is why I'm interested in figuring out how you did this.
To unlock all solutions of this problem, you must solve a newer problem than this one, not older problems.
@James, my solution is very simple, it is pure number.The challenge is from Fermat. Because the big number, it is hard to test. I want use Java's Big Integer, but it has no sqrt operation.
My program gives a wrong answer for n=1, but passes the tests due to insufficient precision. How big is the smallest solution for n=1?
@Tim, it is about 13 digitals. I want to submit another problem use char array as output and avoid to precision.
@James, @Tim, Because of precision, the problem have no meaning, so I have fix the test suits. The output must be char array. Thank you for your support.
I was using the method to parameterize Pythagorean triples (a,b,c) in terms of s and t. Since we're looking at c^4 instead of c^2 (to make sure that c itself is a perfect square), I can see why the numbers got quite large. My solution for n=2 was for larger numbers than my n=3 solution, although even my n=1 solution had the magnitude of a as 10^16 and b was 10^21. I didn't find anything on the order of 10^13.
@James, I think the following link will help you.
Very nice link, Binbin. That is was exactly what I was trying to do, only they didn't include the math error I made in my calculations. :)
well, I seem to have missed the smallest solutions...
wow, very impressive! (I get how to obtain the a=n^8 - 16*n^6 ... solution, but how did you get the long-polynomial "if n<2" solution?)
Recurring Cycle Length (Inspired by Project Euler Problem 26)
Triangle Numbers Below N
Reverse the elements of an array
Given a 4x4 matrix, swap the two middle columns
Area of an Isoceles Triangle
Return fibonacci sequence do not use loop and condition version 3
Return fibonacci sequence do not use loop and condition
Seperate array to small section according to its index position
Determine if input is a Narcissistic number
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office