How many pairs $(a,b)$ are there,such that $a^2 +b^2 = t^2$ where $a,b,t \in \mathbb{N}$ and $a,b \lt 15$?
I need a "fast" approach for solving this problem that could be work under a minute.
How many pairs $(a,b)$ are there,such that $a^2 +b^2 = t^2$ where $a,b,t \in \mathbb{N}$ and $a,b \lt 15$?
I need a "fast" approach for solving this problem that could be work under a minute.
There are only $2$ such primitive pairs by inspection:
Thus one also has:
There are thus $4$ pairs $(a,b)$ with $a,b < 15$.
Added: As pointed out by Ross in the comments to the original question, I did not account for the trivial swapping of $a$ and $b$. This then makes $8$ such pairs. Furthermore, if one includes $0 \in \mathbb{N}$, then $0^2 + a^2 = t^2$ is also a solution when $a = \pm t$.
If you just need the answers I would look at a list of Pythagorean Triples.
P.S. - Why do you need to solve this in under 1 minute?