Is there any kind of direct comparison between megapixels and film size? In other words, how many megapixels do I need to have the resolution of 35mm film or medium format? I know there are a lot of other factors in play, but I'm looking for a basic relationship, assuming all other conditions are equally good. Can someone explain?

Thanks!