Here's a different approach:
Let b := # black socks, w := # white socks.
# possibilities to draw 2 black socks: b choose 2 = ½b² – ½b
# possibilities to draw 2 white socks: b choose 2 = ½w² – ½w
# possibilities to draw black/white pair: bw
That means we need to solve: ½b² – ½b + ½w² – ½w = bw.
Some algebraic manipulations:
½w² – (½+b)w + ½b² – ½b = 0
w² – (2b+1)w + b² – b = 0
With the abc-formula we find:
w = ( 2b+1 ± √((2b+1)² + 4b² + 4b) ) / 2
w = ( 2b+1 ± √(8b+1) ) / 2
w = b + ½ ± ½√(8b+1)
Now to get an integer solution for w, 8b+1 must be a square number. Let's call its root x.
Since 8b+1 is odd, x must be odd as well. The other way around, if x is odd, x² will be always 1 mod 8, so any odd x will suffice.
Finally we can write out b and w in terms of x.
From x = √(8b+1) we obtain that
b = ⅛(x²–1) and
w = ⅛(x²–1) + ½ ± ½x,
for any odd x >
1 (x=1 gives the unwanted solutions b=0, w=0 and b=0, w=1).
Note: substituting x with 2n+1 should lead to the formula which Wolfcastle decribed, but had no proof for yet.
____________________________
Holds:
An Architects Audition,
Artful Architecture,
Salamander,
Elusive Exhibitions,
Leftover Levels,
Six Times Six
Collaborative:
Way Forward,
Advanced Concepts 2
Styles/Mods:
Basalt,
Sandstone,
Garden,
Clock using game elements