add a few more thoughts

This commit is contained in:
filifa 2025-07-18 00:17:25 -04:00
parent 2ca02f9aba
commit ccbb6027c8
1 changed files with 30 additions and 3 deletions

View File

@ -51,11 +51,9 @@
"outputs": [],
"source": [
"def minimal_solution(d):\n",
" var('x,y')\n",
" \n",
" sols = solve_diophantine(x^2 - d*y^2 == 1)\n",
" u, v = sols[0]\n",
" return (abs(u(t=0).simplify_full()), abs(v(t=0).simplify_full()))"
" return (abs(u(t=0)), abs(v(t=0)))"
]
},
{
@ -145,6 +143,35 @@
"max((d for d in range(1, 1001) if not is_square(d)), key=lambda x: pell_fundamental_solution(x)[0])"
]
},
{
"cell_type": "markdown",
"id": "3f573e65",
"metadata": {},
"source": [
"And in case you want to know the minimal $x$ for $x^2 - 661y^2 = 1$:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "b4b119a0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(16421658242965910275055840472270471049, 638728478116949861246791167518480580)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pell_fundamental_solution(661)"
]
},
{
"cell_type": "markdown",
"id": "cfb42d20",