
EXAMPLE

For D=2, the least y for which x^2  D*y^2 = 2 has a solution is 1. The next primes, D, for which x^2  D*y^2 = 2 has a solution are 7 and 23, but the smallest y in each of these cases is also 1, which is equal to the previous record y. So 7 and 23 are not terms of A336788.
The next prime, D, after 23 for which x^2  D*y^2 = 2 has a solution is 31 and the least y for which it has a solution there is y=7, which is larger than 1, so it is a new record y value. So 31 is a term of A336788, and 7 is the corresponding term here.
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 y values satisfying the equation x^2  D*y^2 = 2 begin as follows:
.
x values satisfying minimal
D x^2  D*y^2 = 2 y value record
   
2 1, 7, 41, 239, 1393, ... 1 *
7 1, 17, 271, 4319, ... 1
23 1, 49, 2351, 112799, ... 1
31 7, 21287, 64712473, ... 7 *
47 1, 97, 9311, 893759, ... 1
71 7, 48727, 339139913, ... 7
79 1, 161, 25759, ... 1
103 47, 21387679, ... 47 *
...
The record high minimal values of y (marked with asterisks) are the terms of this sequence. The corresponding values of D are the terms of A336788. (End)
