# Brainteasers¶

### Find a pythagorean triangle¶

\begin{question}
\type{input.function}
\field{integer}
\begin{variables} % In the following the pythagorean numbers are parametrized.
\randint{u}{1}{10}
\randint{v}{1}{10}

\randadjustIf{u,v}{u=v} % see Part 9 http://team.mumie.net/projects/support/wiki/GenericTexProblems

\function{f}{u*u+v*v}       % note: in fact this is a number resp. a constant function.
\functionNormalize{f} % Simplifies the expression as much as possible.
\function{a}{|u*u-v*v|}
\functionNormalize{a}
\function{b}{2*u*v}
\functionNormalize{b}
\end{variables}

\text{\textbf{Question 5}\\\textit{Find a pythagorean triangle with hypotenuse c = $f$.}\\
Note: By definition a\ne 0 and b \ne 0. }

\text{ a = }
\solution{a}
\inputAsFunction{x}{k}