Open in CoCalc with one click!
for d in [ -1 , -2.. -1000]: if is_fundamental_discriminant (d ): h = QuadraticField (d , a). class_number () if h == 1: print d