OFFSET
1,1
COMMENTS
The sequence contains no primes congruent to 3 modulo 4 and all primes congruent to 5 modulo 8.
Different from A385224, primes p such that multiplicative order of -4 modulo p is odd: 593 is in A385224 (ord(-4,593) = 37), but it is not here (x^2 - 1186*y^2 = -1 has no solution); 1601 is not in A385224 (ord(-4,1601) = 200), but it is here (x^2 - 3202*y^2 = -1 has solution (1641,29)). - Jianing Song, Jun 22 2025
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
H. von Lienen, The quadratic form x^2-2py^2, J. Number Theory 10 (1978), 10-15.
MAPLE
select(p -> isprime(p) and [isolve(x^2 - 2*p*y^2 = -1)] <> [], [2, seq(p, p=3..1000, 2)]); # Robert Israel, Dec 23 2025
MATHEMATICA
fQ[n_] := Solve[x^2 + 1 == 2 n*y^2, {x, y}, Integers] != {}; Select[ Prime@ Range@ 160, fQ] (* Robert G. Wilson v, Dec 19 2013 *)
PROG
(Python)
from itertools import count, islice
from sympy import nextprime
from sympy.solvers.diophantine.diophantine import diop_DN
def A133204_gen(startvalue=2): # generator of terms >= startvalue
p = max(2, nextprime(startvalue-1))
while True:
if len(diop_DN(p<<1, -1)):
yield p
p = nextprime(p)
CROSSREFS
KEYWORD
nonn
AUTHOR
David Brink, Dec 29 2007
STATUS
approved
