04/23/2017 UPDATE: Two readers give a more efficient solution:
Fill the 3-gallon jug and empty it into the 5-gallon jug.
Fill the 3-gallon jug again and use it to top off the 5-gallon jug. This leaves 1 gallon in the 3-gallon jug.
Empty the 5-gallon jug. Transfer the remaining gallon from the 3-gallon jug to the 5-gallon jug.
Fill the 3-gallon jug again and pour it into the 5-gallon jug.
This solution requires discarding 5 gallons altogether, where mine required discarding 6. (I think this is probably the alternate solution that Grossman’s method will obtain, but I haven’t had time to check.)