%I #14 Feb 16 2025 08:34:07
%S 2,3,6,11,18,19,22,27,38,43,51,54,59,66,67,83,86,102,107,114,118,123,
%T 131,134,139,146,162,163,166,171,178,179,187,198,211,214,227,242,243,
%U 246,251,258,262,267,278,283,291,307,326,331,339,347,354,358,363,374,379,387,402,411,418,419
%N Positive integers D such that the generalized Pell equation X^2 - D Y^2 = -2 is solvable over the integers.
%C Calculated using Dario Alpern's quadratic Diophantine solver, see link.
%H Robin Visser, <a href="/A377598/b377598.txt">Table of n, a(n) for n = 1..10000</a>
%H Dario Alpern, <a href="https://www.alpertron.com.ar/QUAD.HTM">Generic two integer variable equation solver</a>.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PellEquation.html">Pell Equation</a>.
%e The first fundamental solutions [x(n), y(n)] are (the first entry gives D(n)=a(n)):
%e [2, [0, 1]], [3, [1, 1]], [6, [2, 1]], [11, [3, 1]], [18, [4, 1]], [19, [13, 3]], [22, [14, 3]], [27, [5, 1]], [38, [6, 1]], [43, [59, 9]], [51, [7, 1]], [54, [22, 3]], [59, [23, 3]], [66, [8, 1]], [67, [221, 27]], [83, [9, 1]], [86, [102, 11]], [102, [10, 1]], [107, [31, 3]], [114, [32, 3]], [118, [554, 51]], [123, [11, 1]], [131, [103, 9]], [134, [382, 33]], [139, [8807, 747]], [146, [12, 1]], [162, [140, 11]], [163, [8005, 627]], [166, [41242, 3201]], [171, [13, 1]], [178, [40, 3]], [179, [2047, 153]], [187, [41, 3]], [198, [14, 1]], ...
%o (Python)
%o from itertools import count, islice
%o from sympy.solvers.diophantine.diophantine import diop_DN
%o def A377598_gen(startvalue=1): # generator of terms >= startvalue
%o return filter(lambda d:len(diop_DN(d,-2)), count(max(startvalue,1)))
%o A377598_list = list(islice(A377598_gen(),62)) # _Chai Wah Wu_, Nov 03 2024
%Y Cf. A031396, A261246.
%K nonn
%O 1,1
%A _Robin Visser_, Nov 02 2024