To add to Bruce's post, when building Pythagorean triples, you need to count the number of 'gaps' between studs on each side, not the number of studs. A 1 x 6 brick has six studs but five 'gaps', which is why it works for the long side of Bruce's example.
So, a basic 3,4,5 triangle needs to have four, five, and six studs along each of its respective sides (just as Bruce's example points out). A 5,12,13 triangle, similarly, would require six, thirteen, and fourteen studs on each of its respective sides. It took me longer than I'd like to admit before I fully sorted this out in my mind. (You very well might have seen this right away.)
In short, you have two options: (i) count the 'gaps' if you want to work with the familiar numbers from Pythagorean triples (e.g., 3,4,5), or (ii) add one to each of those numbers and count the studs instead (e.g., 4,5,6).