OFFSET
1,1
COMMENTS
Discriminant = 21. Class number = 2. Binary quadratic forms a*x^2 + b*x*y + c*y^2 have discriminant d = b^2 - 4ac and gcd(a,b,c) = 1 (primitive).
Except a(1) = 3, primes congruent to {5, 17, 20} mod 21. - Vincenzo Librandi, Jul 11 2018
The comment above is true since the binary quadratic forms with discriminant 21 are in two classes as well as two genera, so there is one class in each genus. A141159 is in the other genus, with primes = 7 or congruent to {1, 4, 16} mod 21. - Jianing Song, Jul 12 2018
4*a(n) can be written in the form 21*w^2 - z^2. - Bruno Berselli, Jul 13 2018
Both forms [-1, 3, 3] (reduced) and [5, 9, 3] (not reduced) are properly (via a determinant +1 matrix) equivalent to the reduced form [3, 3, -1], a member of the 2-cycle [[3, 3, -1], [-1, 3, 3]]. The other reduced form is the principal form [1, 3, -3], with 2-cycle [[1, 3, -3], [-3, 3, 1]] (see, e.g., A141159, A139492). - Wolfdieter Lang, Jun 24 2019
REFERENCES
Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966.
D. B. Zagier, Zetafunktionen und quadratische Körper, Springer, 1981.
LINKS
Peter Luschny, Binary Quadratic Forms
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
EXAMPLE
a(3)=17 because we can write 17 = -1^2 + 3*1*2 + 3*2^2 (or 17 = 5*1^2 + 9*1*1 + 3*1^2).
MATHEMATICA
Reap[For[p = 2, p < 2000, p = NextPrime[p], If[FindInstance[p == -x^2 + 3*x*y + 3*y^2, {x, y}, Integers, 1] =!= {}, Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Oct 25 2016 *)
Join[{3}, Select[Prime[Range[250]], MemberQ[{5, 17, 20}, Mod[#, 21]] &]] (* Vincenzo Librandi, Jul 11 2018 *)
PROG
(Magma) [3] cat [p: p in PrimesUpTo(2000) | p mod 21 in [5, 17, 20]]; // Vincenzo Librandi, Jul 11 2018
(Sage) # uses[binaryQF]
# The function binaryQF is defined in the link 'Binary Quadratic Forms'.
Q = binaryQF([-1, 3, 3])
Q.represented_positives(1200, 'prime') # Peter Luschny, Jun 24 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Laura Caballero Fernandez, Lourdes Calvo Moguer, Maria Josefa Cano Marquez, Oscar Jesus Falcon Ganfornina and Sergio Garrido Morales (marcanmar(AT)alum.us.es), Jun 12 2008
EXTENSIONS
More terms from Colin Barker, Apr 05 2015
STATUS
approved