rename function
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"def totient_sieve(limit):\n",
|
"def totient_range(limit):\n",
|
||||||
" totients = [n - 1 for n in range(0, limit)]\n",
|
" totients = [n - 1 for n in range(0, limit)]\n",
|
||||||
" totients[0] = 0\n",
|
" totients[0] = 0\n",
|
||||||
" totients[1] = 1\n",
|
" totients[1] = 1\n",
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
"answer = None\n",
|
"answer = None\n",
|
||||||
"ratio = float('inf')\n",
|
"ratio = float('inf')\n",
|
||||||
"\n",
|
"\n",
|
||||||
"for (n, totient) in enumerate(totient_sieve(limit)):\n",
|
"for (n, totient) in enumerate(totient_range(limit)):\n",
|
||||||
" if n == 0 or n == 1 or totient == n - 1:\n",
|
" if n == 0 or n == 1 or totient == n - 1:\n",
|
||||||
" continue\n",
|
" continue\n",
|
||||||
" \n",
|
" \n",
|
||||||
|
|||||||
Reference in New Issue
Block a user