Here's the primality method I came up with. HeegnerPrimeQ[{a_, b_}, heegner_] := Module[{norm}, If[Not[MemberQ[{1, 2, 3, 7, 11, 19, 43, 67, 163}, heegner]], "not heegner", Switch[heegner, 1, PrimeQ[{a, b}.{1, I}, GaussianIntegers -> True], 2, norm = Norm[{a, b}.{1, Sqrt[2] I}]; If[IntegerQ[norm], If[PrimeQ[norm] && MemberQ[{5, 7}, Mod[norm, 8]], True, False ], If[PrimeQ[norm^2] && MemberQ[{1, 2, 3}, Mod[norm^2, 8]], True, False ]], _, norm = Norm[{a, b}.{1, Sqrt[heegner] I}/2]; If[IntegerQ[norm], If[PrimeQ[norm] && JacobiSymbol[norm, heegner] == -1, True, False ], If[PrimeQ[norm^2] && Not[JacobiSymbol[norm^2, heegner] == -1], True, False ]]]]] --Ed Pegg Jr On Sat, Nov 19, 2016 at 2:15 PM, Eugene Salamin via math-fun < math-fun@mailman.xmission.com> wrote:
You were right the first time. If h=1 mod 4, the ring is Z[(1 + sqrt(h))/2]. Otherwise, the ring is Z[sqrt(h)]. It is understood that square factors are removed from h, so that h is squarefree. This is all derived in Harvey Cohn, "Advanced Number Theory", Dover, p. 45, a wonderful book. -- Gene
From: Dan Asimov <asimov@msri.org> To: math-fun <math-fun@mailman.xmission.com> Sent: Friday, November 18, 2016 11:33 AM Subject: Re: [math-fun] The Hippasus Integers
Correction:
On Nov 18, 2016, at 10:30 AM, Dan Asimov <asimov@msri.org> wrote:
Let O_h be the ring of algebraic integers of ℚ(√-h), Then:
O_1 = Z[i]
O_2 = Z[sqrt(-2)]
O_h = Z[(1 + sqrt(h))/2] for h = -3, -7, -11, -19, -43, -67, -163.
The last line should read:
----- O_h = Z[(1 + sqrt(h))/2] for -h = -3, -7, -11, -19, -43, -67, -163. -----
(and in that e-mail "discover" should be "discoverer". Argggh.
—Dan
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun