"HOMR"
"Original Air Date: 1/07/01"
Homer invests all of the family's life savings into a company that ends up declaring super-duper bankrupcy. To make more money for the family, Homer makes himself available for lab research. While looking at an x-ray of Homer's head, some scientists discover a crayon lodged into Homer's brain. They succesfully remove it and Homer becomes super smart. Homer and Lisa start to bond more, but Homer's friends start to abandon him because he accidentally gets them fired. Eventually Homer lodges another crayon into his brain and goes back to the way he was before.
This is Episode #257 in The Simpsons series. It is Episode #9 in Season 12.