I keep seeing over and over that "to mine bitcoins your computer has to solve mathematical puzzels". OK that's a little vague. Where can I learn more about what exactly is required to generate a block and how the difficulty changes? I wouldn't understand the code itself but a technical paper with some diagrams would be interesting.