From 6b0378bcd5803d40e1d06a35216041feb057693c Mon Sep 17 00:00:00 2001 From: filifa Date: Sun, 20 Jul 2025 14:56:56 -0400 Subject: [PATCH] display the numbers of interest --- notebooks/problem0036.ipynb | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/notebooks/problem0036.ipynb b/notebooks/problem0036.ipynb index 312bbd8..2e84875 100644 --- a/notebooks/problem0036.ipynb +++ b/notebooks/problem0036.ipynb @@ -19,7 +19,25 @@ { "data": { "text/plain": [ - "872187" + "{1,\n", + " 3,\n", + " 5,\n", + " 7,\n", + " 9,\n", + " 33,\n", + " 99,\n", + " 313,\n", + " 585,\n", + " 717,\n", + " 7447,\n", + " 9009,\n", + " 15351,\n", + " 32223,\n", + " 39993,\n", + " 53235,\n", + " 53835,\n", + " 73737,\n", + " 585585}" ] }, "execution_count": 1, @@ -32,6 +50,27 @@ "is_base_10_palindrome = lambda x: str(x) == str(x)[::-1]\n", "\n", "double_palindromes = {n for n in range(1, 1000000) if is_base_2_palindrome(n) and is_base_10_palindrome(n)}\n", + "double_palindromes" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ce61e551", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "872187" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ "sum(double_palindromes)" ] },