Jump to content

Talk:Eisenstein primes

From Rosetta Code

Order of the first 100 Eisenstein primes

There appears to be differences in the order of the first 100 Eisenstein primes:

Lookiong at the value of the 100th Eisenstein prime,

  • Wren, J, jq, Julia, Nim, Phix and Algol 68 show 6.5000 + 4.3301i (ignoring formatting).
  • Raku, Perl and Sidef show 0.5000 + 7.7942i (again, ignoring formatting).
  • FreeBaASIC shows 5.5000 - 6.0622i - although if I run it, I don't get that - I get 6.5000 + 4.3301i.


Presumably, this is due to the calculation of the norm, although the definitions seem the same... ?
--Tigerofdarkness (talk) 15:56, 12 November 2024 (UTC)

At least in the Raku version, the values are sorted by the magnitude of the norm, with no secondary sort. There are 12 Eisenstein primes with a magnitude of 61 (primes 88 through 102). Since we are only displaying 10 of the 12, and there is no specified secondary sort, the primes that get displayed (and the order they are displayed in,) can vary. Not ideal perhaps, but in the absence of more specific instructions, not unsurprising. --Thundergnat (talk) 17:33, 12 November 2024 (UTC)
Thanks, Thundergnat - I didn't think of that. The Wren based ones are sorting by norm, imaginary part and then real part. The sorts used in Raku, Perl and Sidef must all be treating duplicate norms in the same way. --Tigerofdarkness (talk) 20:19, 12 November 2024 (UTC)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.