The Big Bang Theory Season 4 Episode 18
The Prestidigitation Approximation
Priya makes a demand of Sheldon: he stops hanging out with Penny. He spends the episode attempting to break the news to her, but it's Penny that has to guess the problem. Poor Leonard still wants to hang out with Penny on the downlow...
Sheldon spends the episode attempting to figure out Wolowitz's card trick, including hacking and using a Cray supercomputer. It turns out Wolowitz had Raj and Penny in on his trick, but poor Sheldon never learns.