Verified 53 til 57.
This commit is contained in:
@@ -38,8 +38,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def get_digits(n):\n",
|
||||
@@ -80,8 +82,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def is_not_lychrel(n, iterations=50):\n",
|
||||
@@ -98,7 +102,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -112,7 +116,8 @@
|
||||
"source": [
|
||||
"lychrels = [n for n in range(1, 10000) if is_not_lychrel(n) == 0]\n",
|
||||
"s = len(lychrels)\n",
|
||||
"print(s)"
|
||||
"print(s)\n",
|
||||
"assert(s == 249)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -126,7 +131,7 @@
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"completion_date": "",
|
||||
"completion_date": "Mon, 24 Dec 2018, 23:32",
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python3.6",
|
||||
@@ -144,7 +149,10 @@
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.5"
|
||||
},
|
||||
"tags": []
|
||||
"tags": [
|
||||
"lychrel",
|
||||
"airplane"
|
||||
]
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
|
||||
Reference in New Issue
Block a user