"Python offers a [built-in set type](https://docs.python.org/3/library/stdtypes.html) that will only keep track of distinct items for us. We also don't need to worry about overflows, since integers are unlimited precision."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "9fa32dcf",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"9183"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len({a ** b for a in range(2, 101) for b in range(2, 101)})"
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."