login
A306566
y-value of the smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4), p = A002145(n).
3
1, 1, 1, 3, 1, 7, 9, 1, 3, 27, 7, 1, 1, 47, 3, 193, 9, 747, 3383, 627, 1, 153, 217, 9041, 36321, 1, 1, 161, 121, 23, 20687, 699, 537, 233, 2900979, 43, 1, 7199, 5843427, 7, 803, 593, 1, 1, 731153, 59, 79, 326471, 13809, 3, 7, 12507, 541137, 11, 563210019
OFFSET
1,4
COMMENTS
a(n) exists for all n.
X = A306529(n)^2 - (-1)^((p+1)/4), Y = A306529(n)*a(n) gives the smallest solution to x^2 - p*y^2 = 1, p = A002145(n). As a result, all the positive solutions to x^2 - p*y^2 = 2*(-1)^((p+1)/4) are given by (x_n, y_n) where x_n + (y_n)*sqrt(p) = (A306529(n) + a(n)*sqrt(p))*(X + Y*sqrt(p))^n.
FORMULA
If the continued fraction of sqrt(A002145(n)) is [a_0; {a_1, a_2, ..., a_(k-1), a_k, a_(k-1), ..., a_1, 2*a_0}], where {} is the periodic part, let x/y = [a_0; a_1, a_2, ..., a_(k-1)], gcd(x, y) = 1, then A306529(n) = x and a(n) = y.
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
Cf. A002145, A306529 (x-values).
Similar sequences: A094048, A094049 (x^2 - A002144(n)*y^2 = -1); A306618, A306619 (2*x^2 - A002145(n)*y^2 = (-1)^((p+1)/4))).
Sequence in context: A137908 A229837 A019639 * A329943 A372908 A011207
KEYWORD
nonn
AUTHOR
Jianing Song, Mar 25 2019
STATUS
approved