4
$\begingroup$

For many fixed $n$, there are nice criteria to check if a prime $p$ can be expressed as $x^2+ny^2$. For example \begin{align} p=x^2+y^2 &\iff p=2\ \vee\ p\equiv 1\pmod 4 \\ p=x^2+2y^2 &\iff p=2\ \vee\ p\equiv 1,3\pmod 8 \\ p=x^2+3y^2 &\iff p=3\ \vee\ p\equiv 1\pmod 3 \\ p=x^2+4y^2 &\iff p\equiv 1\pmod 4 \\ p=x^2+5y^2 &\iff p=5\ \vee\ p\equiv 1,9\pmod {20} \\ p=x^2+6y^2 &\iff p\equiv 1,7\pmod {24} \\ \end{align} What is the generalization for $p$ not prime? The case $n=1$ is well known: A number $a$ is the sum of two squares iff each prime factor of the form $4k+3$ has an even exponent. What is the the general statement for other $n$?

  • 1
    see here i will hope this will help you! http://maths.dur.ac.uk/gandalf/1213/charlton_primes/charlton_primes_slides.pdf2017-02-18
  • 0
    Re: Case $n=1$. If $a$ is power of $2$ then $a$ is the sum of two squares iff $a>1$ and $a$ is not a power of $ 4.$2017-02-19

1 Answers 1

2

I wrote about primes for $n \leq 29$ at Primes of the form $x^2+ny^2$

As long as $n$ is idoneal things are not bad. When there are just two genera and favorable conditions, we have the principal form $f = x^2 + n y^2$ and another form $g.$ By Gauss composition, if we have a number represented by either $f$ or $g,$ multiplying by a prime $r = g(x,y)$ takes us to a number represented by the other form. Put another way, multiplying by $r$ takes us back and forth between residues and nonresidues mod some prime that divides $n;$ unless $r|n$ which needs a little more thought.

For $x^2 + 5 y^2,$ the exponent for any prime factor $q \equiv 11,13,17,19 \pmod {20} $ must be even. For primes $q=2$ and $q \equiv 3,7 \pmod {20}, $ the sum of the exponents must be even. These latter primes come from $q = 2 u^2 + 2 uv + 3 v^2.$

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./bingo
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2 
1 0 5
Discriminant  20
Maximum number represented? 
300
      0 = 
      1 = 
      4 = 2^2
      5 =  5
      6 = 2 *  3
      9 = 3^2
     14 = 2 *  7
     16 = 2^4
     20 = 2^2 *  5
     21 = 3 *  7
     24 = 2^3 *  3
     25 = 5^2
     29 =  29
     30 = 2 * 3 *  5
     36 = 2^2 * 3^2
     41 =  41
     45 = 3^2 *  5
     46 = 2 *  23
     49 = 7^2
     54 = 2 * 3^3
     56 = 2^3 *  7
     61 =  61
     64 = 2^6
     69 = 3 *  23
     70 = 2 * 5 *  7
     80 = 2^4 *  5
     81 = 3^4
     84 = 2^2 * 3 *  7
     86 = 2 *  43
     89 =  89
     94 = 2 *  47
     96 = 2^5 *  3
    100 = 2^2 * 5^2
    101 =  101
    105 = 3 * 5 *  7
    109 =  109
    116 = 2^2 *  29
    120 = 2^3 * 3 *  5
    121 = 11^2
    125 = 5^3
    126 = 2 * 3^2 *  7
    129 = 3 *  43
    134 = 2 *  67
    141 = 3 *  47
    144 = 2^4 * 3^2
    145 = 5 *  29
    149 =  149
    150 = 2 * 3 * 5^2
    161 = 7 *  23
    164 = 2^2 *  41
    166 = 2 *  83
    169 = 13^2
    174 = 2 * 3 *  29
    180 = 2^2 * 3^2 *  5
    181 =  181
    184 = 2^3 *  23
    189 = 3^3 *  7
    196 = 2^2 * 7^2
    201 = 3 *  67
    205 = 5 *  41
    206 = 2 *  103
    214 = 2 *  107
    216 = 2^3 * 3^3
    224 = 2^5 *  7
    225 = 3^2 * 5^2
    229 =  229
    230 = 2 * 5 *  23
    241 =  241
    244 = 2^2 *  61
    245 = 5 * 7^2
    246 = 2 * 3 *  41
    249 = 3 *  83
    254 = 2 *  127
    256 = 2^8
    261 = 3^2 *  29
    269 =  269
    270 = 2 * 3^3 *  5
    276 = 2^2 * 3 *  23
    280 = 2^3 * 5 *  7
    281 =  281
    289 = 17^2
    294 = 2 * 3 * 7^2

           1           0           5

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 

================================================================

For $x^2 + 6 y^2,$ the exponent for any prime factor $q \equiv 13,17,19,23 \pmod {24} $ must be even. For primes $q=2,3$ and $q \equiv 5,11 \pmod {24}, $ the sum of the exponents must be even. These latter primes come from $q = 2 u^2 + 3 v^2.$

=============================================

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./bingo
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2 
1 0 6
Discriminant  24
Maximum number represented? 
300
      0 = 
      1 = 
      4 = 2^2
      6 = 2 *  3
      7 =  7
      9 = 3^2
     10 = 2 *  5
     15 = 3 *  5
     16 = 2^4
     22 = 2 *  11
     24 = 2^3 *  3
     25 = 5^2
     28 = 2^2 *  7
     31 =  31
     33 = 3 *  11
     36 = 2^2 * 3^2
     40 = 2^3 *  5
     42 = 2 * 3 *  7
     49 = 7^2
     54 = 2 * 3^3
     55 = 5 *  11
     58 = 2 *  29
     60 = 2^2 * 3 *  5
     63 = 3^2 *  7
     64 = 2^6
     70 = 2 * 5 *  7
     73 =  73
     79 =  79
     81 = 3^4
     87 = 3 *  29
     88 = 2^3 *  11
     90 = 2 * 3^2 *  5
     96 = 2^5 *  3
     97 =  97
    100 = 2^2 * 5^2
    103 =  103
    105 = 3 * 5 *  7
    106 = 2 *  53
    112 = 2^4 *  7
    118 = 2 *  59
    121 = 11^2
    124 = 2^2 *  31
    127 =  127
    132 = 2^2 * 3 *  11
    135 = 3^3 *  5
    144 = 2^4 * 3^2
    145 = 5 *  29
    150 = 2 * 3 * 5^2
    151 =  151
    154 = 2 * 7 *  11
    159 = 3 *  53
    160 = 2^5 *  5
    166 = 2 *  83
    168 = 2^3 * 3 *  7
    169 = 13^2
    175 = 5^2 *  7
    177 = 3 *  59
    186 = 2 * 3 *  31
    193 =  193
    196 = 2^2 * 7^2
    198 = 2 * 3^2 *  11
    199 =  199
    202 = 2 *  101
    214 = 2 *  107
    216 = 2^3 * 3^3
    217 = 7 *  31
    220 = 2^2 * 5 *  11
    223 =  223
    225 = 3^2 * 5^2
    231 = 3 * 7 *  11
    232 = 2^3 *  29
    240 = 2^4 * 3 *  5
    241 =  241
    249 = 3 *  83
    250 = 2 * 5^3
    252 = 2^2 * 3^2 *  7
    256 = 2^8
    262 = 2 *  131
    265 = 5 *  53
    271 =  271
    279 = 3^2 *  31
    280 = 2^3 * 5 *  7
    289 = 17^2
    292 = 2^2 *  73
    294 = 2 * 3 * 7^2
    295 = 5 *  59
    297 = 3^3 *  11
    298 = 2 *  149

           1           0           6

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 

==============================

================================================================

For $x^2 + 10 y^2,$ the exponent for any prime factor $q \equiv 3, 17, 21, 27, 29, 31, 33, 39 \pmod {40} $ must be even. For primes $q=2,5$ and $q \equiv 7, 13, 23, 37 \pmod {40}, $ the sum of the exponents must be even. These latter primes come from $q = 2 u^2 + 5 v^2.$

=============================================

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./bingo
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2 
1 0 10
Discriminant  40
Maximum number represented? 
300
      0 = 
      1 = 
      4 = 2^2
      9 = 3^2
     10 = 2 *  5
     11 =  11
     14 = 2 *  7
     16 = 2^4
     19 =  19
     25 = 5^2
     26 = 2 *  13
     35 = 5 *  7
     36 = 2^2 * 3^2
     40 = 2^3 *  5
     41 =  41
     44 = 2^2 *  11
     46 = 2 *  23
     49 = 7^2
     56 = 2^3 *  7
     59 =  59
     64 = 2^6
     65 = 5 *  13
     74 = 2 *  37
     76 = 2^2 *  19
     81 = 3^4
     89 =  89
     90 = 2 * 3^2 *  5
     91 = 7 *  13
     94 = 2 *  47
     99 = 3^2 *  11
    100 = 2^2 * 5^2
    104 = 2^3 *  13
    106 = 2 *  53
    110 = 2 * 5 *  11
    115 = 5 *  23
    121 = 11^2
    126 = 2 * 3^2 *  7
    131 =  131
    139 =  139
    140 = 2^2 * 5 *  7
    144 = 2^4 * 3^2
    154 = 2 * 7 *  11
    160 = 2^5 *  5
    161 = 7 *  23
    164 = 2^2 *  41
    169 = 13^2
    171 = 3^2 *  19
    176 = 2^4 *  11
    179 =  179
    184 = 2^3 *  23
    185 = 5 *  37
    190 = 2 * 5 *  19
    196 = 2^2 * 7^2
    206 = 2 *  103
    209 = 11 *  19
    211 =  211
    224 = 2^5 *  7
    225 = 3^2 * 5^2
    234 = 2 * 3^2 *  13
    235 = 5 *  47
    236 = 2^2 *  59
    241 =  241
    250 = 2 * 5^3
    251 =  251
    254 = 2 *  127
    256 = 2^8
    259 = 7 *  37
    260 = 2^2 * 5 *  13
    265 = 5 *  53
    266 = 2 * 7 *  19
    275 = 5^2 *  11
    281 =  281
    286 = 2 * 11 *  13
    289 = 17^2
    296 = 2^3 *  37
    299 = 13 *  23

           1           0          10

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 

==============================================

  • 0
    Thanks a lot. The idoneal case is absolutely sufficient for me right now. Though I don't really see how you get to your result2017-02-18
  • 0
    ah, okay that makes it clearer. I think that will be enough for me to figure out the details.2017-02-18