Problem 44788. Find the right number make the equation
Given positive integer number n, find the right positive integer number a, b , so that
(1) sqrt(a + n * b) is a positive integer number
(2) sqrt(hypot(a,b)) is a positive integer number
Note: the output must be char array!
Have fun!
Solution Stats
Problem Comments
-
9 Comments
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.
https://www.mathpages.com/home/kmath022/kmath022.htm
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. :)
Solution Comments
Show commentsGroup

Number Manipulation III
- 15 Problems
- 14 Finishers
- High Precision Square Root (Inspired by Project Euler 80)
- Damping of Servomotors with Tachometer Feedback
- Find the right number make the equation
- Deriving a function using the difference quotient
- Fast 1-D Convolution (full shape)
- Fast 1-D Convolution (same shape)
- Fast 1-D Convolution (valid shape)
- Lambert's W
- First use of arrayfun() and anonymous function @(x)
- Cell Operator *
- Product of two multivariate polynomials
- Multivariate polynomials - convert monomial form to array
- Multivariate polynomials - overload multiplication
- Multivariate polynomials - emulate symbolic form
- Rewrite setdiff to account for non-unique values
Problem Recent Solvers10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!