This same problem also appears here: http://perplexus.info/show.php?pid=9271
A drawer contains a mixture of red socks and blue socks, at most $2014$ in total. It so happens that, when two socks are selected randomly without replacement, there is a probability of precisely $\frac23$ that both are red or both are blue.
What is the maximum possible number of red socks in the drawer that is consistent with this data?