• Patterned division

    From mhx@mhx@iae.nl (mhx) to comp.lang.forth on Sun Sep 29 07:11:56 2024
    From Newsgroup: comp.lang.forth

    Factoid from Fermat's library:

    "Every number of the form ABABAB (basis 10) is divisible by 37."
    Example: 111111 37 /mod . . is 3003 0, 13691369 37 /mod . . is
    370037 0.

    This is obvious once you know how it is done, and then you
    also see it works for 13, 7, and 3.

    Does the approach work for other number bases (yes), and can
    it be used to prove primeness of numbers which have
    a repeating digit pattern in a certain number base?

    -marcel
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sun Sep 29 14:57:30 2024
    From Newsgroup: comp.lang.forth

    In article <cc2168f2a41861f350e75d472385c5ba@www.novabbs.com>,
    mhx <mhx@iae.nl> wrote:
    Factoid from Fermat's library:

    "Every number of the form ABABAB (basis 10) is divisible by 37."
    Example: 111111 37 /mod . . is 3003 0, 13691369 37 /mod . . is
    370037 0.

    This is obvious once you know how it is done, and then you
    also see it works for 13, 7, and 3.

    Does the approach work for other number bases (yes), and can
    it be used to prove primeness of numbers which have
    a repeating digit pattern in a certain number base?

    Primeness is the absence of dividers. Testing cannot
    prove the absence of bugs.
    A repeating digit pattern can reveal the presence of
    dividers. For instance a pattern repeated n times
    where n is not a prime has a divider.
    77777777777777 is divisable by 7 (huh)
    11111111111111 is divisable by 11 (7 repetitions of 11)
    You can convince yourself by doing a long division.

    Mersenne primes are in fact a sequence of n 1's in binary, M_n.
    I have just proven that for such a prime M_n , n itself
    must be prime. The great internet mersenne prime search
    would not be interesting, if you can tell for p whether
    M_p would be prime.

    So no. Not a silver bullet.

    -marcel

    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.
    --- Synchronet 3.20a-Linux NewsLink 1.114