login
A031397
Nonsquarefree k such that Pell equation x^2 - k*y^2 = -1 is soluble.
4
50, 125, 250, 325, 338, 425, 845, 925, 1025, 1250, 1325, 1445, 1450, 1525, 1625, 1682, 1825, 1850, 2050, 2125, 2197, 2425, 2725, 2738, 2825, 2873, 2890, 3050, 3125, 3250, 3425, 3625, 3725, 3925, 4250, 4325, 4394, 4625, 4825, 4901, 4913
OFFSET
1,1
REFERENCES
Harvey Cohn, Advanced Number Theory, Dover Publications, New York, N.Y. (1980).
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000 (first 500 terms from Robert Israel)
S. Vidhyalakshmi, V. Krithika, and K. Agalya, On The Negative Pell Equation y^2 = 72x^2 - 8, International Journal of Emerging Technologies in Engineering Research (IJETER) Volume 4, Issue 2, February (2016).
MAPLE
filter:= t -> not numtheory:-issqrfree(t) and [isolve(x^2 - t*y^2 = -1)]<>[]:
select(filter, [$1..10000]); # Robert Israel, Jul 10 2018
MATHEMATICA
r[n_] := Reduce[x>0 && y>0 && x^2 - n y^2 == -1, {x, y}, Integers];
Reap[For[n = 1, n <= 5000, n++, If[!SquareFreeQ[n], If[r[n] =!= False, Print[n]; Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Mar 05 2019 *)
PROG
(Python)
from itertools import count, islice
from sympy import factorint
from sympy.solvers.diophantine.diophantine import diop_DN
def A031397_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n: max(factorint(n).values(), default=0)>1 and len(diop_DN(n, -1)), count(max(startvalue, 1)))
A031397_list = list(islice(A031397_gen(), 52)) # Chai Wah Wu, Dec 22 2025
CROSSREFS
Equals {A003814} minus {A003654}, cf. A031396.
Sequence in context: A248531 A222822 A212226 * A045181 A093194 A043474
KEYWORD
nonn
EXTENSIONS
Offset changed by Robert Israel, Jul 10 2018
STATUS
approved