package
0.0.0-20241125083417-0b09d6ac830b
Repository: https://github.com/yydaily/project-euler-solution.git
Documentation: pkg.go.dev

# README

2011 Nines

Consider the real number $\sqrt{2}+\sqrt{3}$. When we calculate the even powers of $\sqrt 2 + \sqrt 3$ we get:

$$ \begin{aligned} (\sqrt 2 + \sqrt 3)^2 = 9.&898979485566356 \cdots\ (\sqrt 2 + \sqrt 3)^4 = 97.&98979485566356 \cdots\ (\sqrt 2 + \sqrt 3)^6 = 969.&998969071069263 \cdots\ (\sqrt 2 + \sqrt 3)^8 = 9601.&99989585502907 \cdots\ (\sqrt 2 + \sqrt 3)^{10} = 95049.&999989479221 \cdots\ (\sqrt 2 + \sqrt 3)^{12} = 940897.&9999989371855 \cdots\ (\sqrt 2 + \sqrt 3)^{14} = 9313929.&99999989263 \cdots\ (\sqrt 2 + \sqrt 3)^{16} = 92198401.&99999998915 \cdots\ \end{aligned} $$

It looks as if the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing. In fact it can be proven that the fractional part of $(\sqrt 2 + \sqrt 3)^{2 n}$ approaches $1$ for large $n$.

Consider all real numbers of the form $\sqrt p + \sqrt q$ with $p$ and $q$ positive integers and $p<q$, such that the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$ approaches $1$ for large $n$.

Let $C(p,q,n)$ be the number of consecutive nines at the beginning of the fractional part of $(\sqrt p + \sqrt q)^{2n}$.

Let $N(p, q)$ be the minimal value of $n$ such that $C(p,q,n)≥2011$.

Find $\sum N(p,q)$ for $p+q≤2011$.