In equal temperament, you can find the frequency ratio of two notes in an interval by raising 2 to the power of X/12, where X is the number of semitones.
Once you know that, you can look for some green numbers that, when divided, would have that same ratio.
So to make a chord, you figure out the ratios. Here's an example for major triads. First, some math to go from equal temperament to ratios. A major third is 4 semitones, so that's 2*(4/12), and a perfect fifth is 7 semitones, so that's 2*(7/12). Those work out to 1.2599 and 1.4983.
They're really "supposed"[1] to be 1.25 and 1.5, i.e. 5/4 and 3/2.
So now that you know these ratios, you can look for 3 numbers that satisfy the two ratios. If you change 3/2 into 4/6, then it becomes pretty clear that 4 and 5 will satisfy the 5/4 ratio (giving you a major third) and that 4 and 6 will satisfy the 6/4 ratio (giving you a perfect fifth). So to get a major triad, you can play 4, 5, and 6.
With similar reasoning, you can figure out that 10, 12, and 15 form a minor triad.
----
[1] If you look at equal temperament as a compromise that doesn't get quite the "right" ratios.