A254930 Fundamental positive solution x = x2(n) of the second class of the Pell equation x^2 - 2*y^2 = A001132(n), n >= 1 (primes congruent to 1 or 7 mod 8).
5, 7, 11, 9, 13, 17, 13, 19, 23, 17, 15, 21, 25, 17, 23, 27, 35, 23, 29, 21, 41, 25, 31, 23, 35, 29, 39, 43, 37, 31, 27, 49, 53, 33, 31, 37, 47, 41, 55, 59, 31, 45, 39, 49, 37, 35, 61, 37, 35
Offset: 1
Examples
n = 3: 11^2 - 2*7^2 = 23 = A001132(3) = A007522(2). The first pairs of these second class solutions [x2(n), y2(n)] are (a star indicates primes congruent to 1 (mod 8)): n A001132(n) a(n) A254931(n) 1 7 5 3 2 17 * 7 4 3 23 11 7 4 31 9 5 5 41 * 13 8 6 47 17 11 7 71 13 7 8 73 * 19 12 9 89 * 17 10 10 97 * 15 8 11 103 21 13 12 113 * 25 16 13 127 17 9 14 137 * 23 14 15 151 27 17 16 167 35 23 17 191 23 13 18 193 * 29 18 19 199 21 11 20 223 41 27 ...
Programs
-
Mathematica
Reap[For[p = 2, p < 1000, p = NextPrime[p], If[MatchQ[Mod[p, 8], 1|7], rp = Reduce[x > 0 && y > 0 && x^2 - 2 y^2 == p, {x, y}, Integers]; If[rp =!= False, xy = {x, y} /. {ToRules[rp /. C[1] -> 1]}; x2 = xy[[-1, 1]] // Simplify; Print[x2]; Sow[x2]]]]][[2, 1]] (* Jean-François Alcover, Oct 28 2019 *)
Comments