Loading ...
Sorry, an error occurred while loading the content.

New strong pseudo-carmody prime found!

Expand Messages
  • Phil Carmody
    There is a serious side to this, skip to the end if you don t want the silly story. 91 is not the only carmody prime - I ve found a new one! 299. Like 91 it s
    Message 1 of 2 , Sep 23, 2006
    • 0 Attachment
      There is a serious side to this, skip to the end if you don't want the silly
      story.


      91 is not the only carmody prime - I've found a new one!

      299.

      Like 91 it's easy to see it's the difference of 2 squares (18^2-5^2), however,
      it looks prime - not just to the (carmodian) eye, but also to a well known fast
      prime generation library when compiled on a PowerPC architecture.

      <<<
      $ ./primes 1 300
      2
      3
      ...
      293
      299
      >>>

      Yikes. And there are many more...


      The end:
      Is anyone using any of my sieves on PPC? If they are, then let me know, and
      I'll diagnose whether this bug may be an issue for your application. As far as
      I am aware, no-one with a PPC is using the code that has the bug. I've
      reproduced the identical error on a Pegasos G4 linux gcc3.4.3 system and a G5
      linux gcc4.0 system.

      Phil

      () ASCII ribbon campaign () Hopeless ribbon campaign
      /\ against HTML mail /\ against gratuitous bloodshed

      [stolen with permission from Daniel B. Cristofani]

      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • thefatphil
      ... The library in question was DJB s primegen, and the issue was that gcc on the Power architecture seems to like having _unsigned_ chars by default (unlike
      Message 2 of 2 , Nov 9, 2006
      • 0 Attachment
        --- In primenumbers@yahoogroups.com, Phil Carmody <thefatphil@...> wrote:
        > prime generation library when compiled on a PowerPC architecture.

        The library in question was DJB's primegen, and the issue was that gcc
        on the Power architecture seems to like having _unsigned_ chars by
        default (unlike all other integer types, which, if not explicitly
        marked 'unsigned' will be signed). This messes with a couple of the
        tables of constants. The solution is either to force the compiler to
        used signed chars by default, or to explicitly change the structures
        such that the members are explicitly signed. Dan actually fixed this
        within a day of me reporting the bug to him, but I forgot to report
        back here. His webpage has been updated to document this gcc-gotcha.

        Phil
      Your message has been successfully submitted and would be delivered to recipients shortly.