
EXAMPLE

For D=31, the least x for which x^2  Dy^2 = 2 has a solution is 39. The next prime, D, for which x^2  Dy^2 = 2 has a solution is 47, but the smallest x in this case is 7, which is less than 39. The next prime, D, after 47 for which x^2  Dy^2 = 2 has a solution is 71 and the least x for which it has a solution is x=59, which is larger than 39, a new record value, so 71 is a term of A336786 and 59 is the corresponding term of this sequence. 47 is not a term of A336786 because the least x for which x^2  47*y^2 = 2 has a solution is not a record value.
From Jon E. Schoenfield, Feb 24 2021: (Start)
Primes D for which the equation x^2  D*y^2 = 2 has integer solutions begin 2, 7, 23, 31, 47, 71, 79, 103, ...; at those values of D, the minimal x values satisfying the equation x^2  D*y^2 = 2 begin as follows:
.
x values satisfying minimal
D x^2  D*y^2 = 2 x value record
   
2 2, 10, 58, 338, 1970, ... 2 *
7 3, 45, 717, 11427, ... 3 *
23 5, 235, 11275, 540965, ... 5 *
31 39, 118521, 360303801, ... 39 *
47 7, 665, 63833, 6127303, ... 7
71 59, 410581, 2857643701, ... 59 *
79 9, 1431, 228951, ... 9
103 477, 217061235, ... 477 *
...
The record high minimal values of x (marked with asterisks) are the terms of this sequence. The corresponding values of D are the terms of A336786. (End)
