OFFSET
1,4
COMMENTS
a(n) exists for all n.
FORMULA
EXAMPLE
The smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4) for the first primes congruent to 3 modulo 4:
n | Equation | x_min | y_min
1 | x^2 - 3*y^2 = -2 | 1 | 1
2 | x^2 - 7*y^2 = +2 | 3 | 1
3 | x^2 - 11*y^2 = -2 | 3 | 1
4 | x^2 - 19*y^2 = -2 | 13 | 3
5 | x^2 - 23*y^2 = +2 | 5 | 1
6 | x^2 - 31*y^2 = +2 | 39 | 7
7 | x^2 - 43*y^2 = -2 | 59 | 9
8 | x^2 - 47*y^2 = +2 | 7 | 1
9 | x^2 - 59*y^2 = -2 | 23 | 3
PROG
(PARI) b(p) = if(isprime(p)&&p%4==3, y=1; while(!issquare(p*y^2 + 2*(-1)^((p+1)/4)), y++); y)
forprime(p=3, 500, if(p%4==3, print1(b(p), ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Mar 25 2019
STATUS
approved