TITLE: Are there prime numbers not irreducible in $\mathcal{O}_{\mathbb{Q}(\sqrt{577})}$?
QUESTION [7 upvotes]: All small (rational) primes I've looked at seem to be irreducible elements in the ring $\mathcal{O}_{\mathbb{Q}(\sqrt{577})}$. Often they're irreducible but not prime. And of course $577 = (\sqrt{577})^2$.
Looking at ideals, it's clear that $$\langle 2 \rangle = \left\langle 2, \frac{1}{2} + \frac{\sqrt{577}}{2} \right\rangle^2,$$ $$\langle 3 \rangle = \left\langle 3, \frac{1}{2} - \frac{\sqrt{577}}{2} \right\rangle \left\langle 3, \frac{1}{2} + \frac{\sqrt{577}}{2} \right\rangle,$$ $\langle 5 \rangle$ and $\langle 7 \rangle$ are prime, etc.
It's then not difficult to find failures of unique factorization such as $$12 = 2^2 \times 3 = (-1) \left(\frac{23}{2} - \frac{\sqrt{577}}{2} \right) \left(\frac{23}{2} + \frac{\sqrt{577}}{2} \right).$$ 
But I can't seem to find a case of principal ideals $\langle a \pm b \sqrt{577} \rangle$, with nonzero $a, b \in \mathbb{Q}$ (either integers or halves of integers, to be precise) having prime norm.
For contrast, observe that in $\mathbb{Z}[\sqrt{15}]$ (not UFD either), we have $\langle 11 \rangle = \langle 2 - \sqrt{15} \rangle \langle 2 + \sqrt{15} \rangle$.
Is this theoretically impossible in $\mathcal{O}_{\mathbb{Q}(\sqrt{577})}$, or have I just not looked far enough?
EDIT: Thanks to quid for editing my question to be more precise in regards to terminology. I am editing the question now because in my non-UFD example I used $24$ when I should have used $12$. It seems no one would have caught that but it was bothering me.

REPLY [3 votes]: I looked, my program for showing the positive primes represented by an indefinite form is actually quite short. I will put a brief demonstration run below, then the full program. The method is due to John Horton Conway, in chapter one of  his little book The Sensual Quadratic Form. Another book was very helpful with the diagram ("topograph"), John Stillwell, Elements of Number Theory, especially pages 38-39, 90-100. 
Worth emphasis: at first glance, the problem of finding the numbers with small absolute value represented by an indefinite quadratic form seems messy, we cannot just bound the variables. Conway's topograph method turns the picture around; there is a "river" along which the values of the form repeat forever. Then, the farther we move away from the river, the larger the absolute values get. One side of the river is numbers (primitively) represented. It turns out to be a finite set of rooted trees, where the roots are locations on the river. Values of the form are not at the graph vertices or the edges, rather values are in the spaces in between edges. Each space off the river has a "level" away from the river, compared with the values along the river itself. At each level, we get a value with the minimum (absolute value) for that level. Once we do enough layers for that minimum to exceed the bound we wanted, we are done. Deterministic and definitive.
jagy@phobeusjunior:~$ g++  -o     Conway_Positive_Primes     Conway_Positive_Primes.cc  -lm
In file included from /usr/include/c++/4.8/backward/strstream:51:0,
                 from Conway_Positive_Primes.cc:12:
/usr/include/c++/4.8/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
 #warning \
  ^
jagy@phobeusjunior:~$ ./Conway_Positive_Primes  1 1 -2  50  13
           1           1          -2   original form 

square discriminant  9

jagy@phobeusjunior:~$ ./Conway_Positive_Primes  1 1 -3  50  13
           1           1          -3   original form 

           1           3          -1   Lagrange-Gauss reduced 



 Represented (positive) primes up to  50

     3    13    17    23    29    43

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=   
 these are the collection of remainders when dividing by   13

      0      3      4     10



 Represented (positive) primes up to  50  and value mod    13

           1           1          -3   original form 

jagy@phobeusjunior:~$ 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <sstream>
#include <list>
#include <set>
#include <math.h>
#include <iomanip>
#include <string>
#include <algorithm>
#include <iterator>
#include <strstream>


using namespace std;




//  this file is named     Conway_Positive_Primes.cc 
//  main writing   June 2014


// to compile
//        g++  -o     Conway_Positive_Primes     Conway_Positive_Primes.cc  -lm




void insert_primitive_reps(unsigned int a, unsigned int h, unsigned int b, unsigned int M,  set<unsigned int>  *setPtr)
{
 // cout << setw(12) << a  << setw(12) << h  << setw(12) << b << "   insert_primitive_reps"    << endl;
  if ( a <= M )
  {
    (*setPtr).insert(a);
    if ( b <= M )
    {
      (*setPtr).insert(b);
      if ( a <= M - b && h <= M - a - b)
      {
        if( a <= M - a - h ) insert_primitive_reps(a, h + 2 * a, a + b + h, M, setPtr);
        if( b <= M - b - h ) insert_primitive_reps(a + b + h, h + 2 * b,b, M, setPtr);
         // comment: once a+b+h <= M, min(2a+h, 2b+h) <= M
      }  // if a + b + h
    } // if  b
  } // if a

} // end insert_primitive_rep



int IntSqrt(int i)
{
  // cerr << "called intsqrt  with   " << i << endl;
  if ( i <= 0 ) return 0;
  else if ( i <= 3) return 1;
  else if ( i >= 2147395600) return 46340;
  else
  {
    float r;
    r = 1.0 * i;
    r = sqrt(r);
    int root = (int) ceil(r);
    while ( root * root   <= i ) ++root;
    while ( root * root   > i ) --root;
    return  root ;
  }
}


string stringify(int x)
 {
   ostringstream o;
   o << x  ;
   return o.str();
 }


string Factored(unsigned int i)
{
  string fac;
  fac = " = ";
  int p = 2;
 unsigned int temp = i;
  if (temp < 0 )
  {
    temp *= -1;
    fac += " -1 * ";
  }

  if ( 1 == temp) fac += " 1 ";
  if ( temp > 1)
  {
    int primefac = 0;
    while( temp > 1 && p * p <= temp)
    {
      if (temp % p == 0)
      {
        ++primefac;
        if (primefac > 1) fac += " * ";
         fac += stringify( p) ;
        temp /= p;
        int exponent = 1;
        while (temp % p == 0)
        {
          temp /= p;
          ++exponent;
        } // while p is fac
        if ( exponent > 1)
        {
          fac += "^" ;
          fac += stringify( exponent) ;
        }
      }  // if p is factor
      ++p;
    } // while p
    if (temp > 1 && primefac >= 1) fac += " * ";
    if (temp > 1 ) fac += stringify( temp)  ;
  } // temp > 1
  return fac;
} // Factored


int PrimeQ(int i)
{
  if ( i < 0 ) i *= -1;
  if ( i <= 3) return 1;
  else
  {
    int boo = 1;
    int j = 2;

    while (boo && j * j   <= i )
    {
      if ( i %  j  == 0) boo = 0;
      ++j;
    }
    return boo;
  }
}


int main(int argc, char *argv[])
{
  if ( argc != 6) cout << "Usage: ./Conway_Positive_Primes A B C      Bound    Modulus " << endl;
  else {



  int a,b,c, discr;
     int N,M;
    a = atoi(argv[1]);
        b = atoi(argv[2]);
    c = atoi(argv[3]);
   M = atoi(argv[4]);
     N = atoi(argv[5]);
 cout << setw(12) << atoi(argv[1])  << setw(12) << atoi(argv[2])  << setw(12) << atoi(argv[3]) << "   original form " << endl    << endl;
      int d = b * b - 4 * a * c ;
      int droot = IntSqrt(d) ;
      if ( d <= 0) cout << "nonpositive discriminant  " << d << endl << endl;
       if (d == droot * droot) cout << "square discriminant  " << d << endl << endl;

      if (d > 0 && d != droot * droot)
      {



      int aa,bb,cc;
      while ( a <= 0 || c >= 0 || b <= abs(a+c) )
      {
        int delta, cAbs;
       cAbs = c;
        if (cAbs < 0) cAbs *= -1;

       delta =   (b + droot)/( 2 * cAbs)  ;
  if (c < 0) delta *= -1;
     aa = c ; bb = 2 * c * delta - b ; cc =  c * delta * delta - b * delta + a ;
       a = aa; b = bb; c = cc;
       } // while not reduced with a > 0


  cout << setw(12) << a  << setw(12) << b  << setw(12) << c << "   Lagrange-Gauss reduced " << endl    << endl;


        int a_old = a;
        int b_old = b;
        int c_old = c;

        int goon = 1;


set<unsigned int>  S;





        while (goon )
        {


         int newval = a+b+c;

          if ( newval > 0 )
          {
       //      cout << setw(65) << b + 2 * a << endl;
             insert_primitive_reps(a, b + 2 * a,newval ,M,  &S); // note ampersand
             b+= 2 * c ;

             a = newval;

           } // newval > 0
         else if ( newval < 0 )
          {
     //        cout << setw(5) << -1 * ( b + 2 * c) << endl;

             b+= 2 * a ;
             c = newval;

           } // newval < 0


         goon = (a != a_old)  || (b != b_old)  || (c != c_old)  ;

        } // while goon


  cout << endl << endl << " Represented (positive) primes up to  " << M << endl << endl;
 set<unsigned int> mods ;

 int rount = 0;
 set<unsigned int>::iterator iterU;
 for(iterU = S.begin() ;   iterU != S.end() ; ++iterU)
    {

      unsigned int p = *iterU;
     if ( p > 1 && PrimeQ(p) )
      {
       cout << setw(6) << p ;
       ++rount;
       if (rount % 10 == 0 ) cout << endl;
     // cout << setw(12) << p << setw(12) << p %  N << endl ;
      mods.insert( p % N);


      } // if prime
    }

  int count = 0;
  cout << endl << endl;
  cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=   " << endl;
  cout<< " these are the collection of remainders when dividing by   " << N << endl << endl;
 for(iterU = mods.begin() ;   iterU != mods.end() ; ++iterU )
  {
    int    u = *iterU ;
    ++count;
    {
      cout << setw(7) << u  ;
      if (0 == count % 10) cout << endl;
    }
  } // for iterU

  cout << endl << endl;




  cout << endl << endl << " Represented (positive) primes up to  " << M <<  "  and value mod    " << N << endl << endl;
 cout << setw(12) << atoi(argv[1])  << setw(12) << atoi(argv[2])  << setw(12) << atoi(argv[3]) << "   original form " << endl    << endl;
       } // not square


    } // else argc
    return 0 ;
}    //  end of program


//  g++  -o     Conway_Positive_Primes     Conway_Positive_Primes.cc  -lm

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=