Project Euler #66: Diophantine equation

  • + 1 comment

    I'll summarize the Wikipedia/Wolfram info

    1. The minimum solution is the numerator of a continued fraction aproximation of sqrt(D)
    2. let p be the period of the continued fraction and n_i / d_i be the ith convergent in the sequence of continued fraction aproximations of sqrt(D)
    3. if D is even, the solution is n_(p-1)
    4. if D is odd, the solution is n_(2p-1)
    5. Project Euler+ problems 64 and 65 lay the groundwork for this problem