• Four Digit Code Problem

    From David Entwistle@qnivq.ragjvfgyr@ogvagrearg.pbz to rec.puzzles on Thu Aug 20 10:45:18 2026
    From Newsgroup: rec.puzzles

    It was raining, here in the UK, this morning - the first significant rain
    in weeks. So, I asked AI to generate a maths-based puzzle. The first
    attempt was trivial and the next four attempts turned out to have no
    solution. We eventually arrived at the following. I'm not sure, but don't think there is a solution for any given weighted prime product.

    Can anyone verify that, or possibly convert this to a puzzle that does
    have a solution? AI asked:

    Puzzle: Digit Equation with Guaranteed Consistency

    Find the unique 4-digit code ABCD where digits are distinct and A != 0,
    such that:

    1. rCLWeighted prime productrCY: 2A + 3B + 5C + 7D = 111
    2. The 2-digit number AB is divisible by 3.
    3. The 2-digit number CD is divisible by 4.
    4. gcd(AB,CD)=1.
    5. The 4-digit number ABCD is divisible by 9.

    I was asked to reply with the code ABCD.

    Thanks.

    PS It has stopped raining now.
    --
    David Entwistle
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Entwistle@qnivq.ragjvfgyr@ogvagrearg.pbz to rec.puzzles on Thu Aug 20 11:06:20 2026
    From Newsgroup: rec.puzzles

    On Thu, 20 Aug 2026 10:45:18 -0000 (UTC), David Entwistle wrote:

    think there is a solution for any given weighted prime product.

    1. rCLWeighted prime productrCY: 2A + 3B + 5C + 7D = 111

    I added the words "weighted prime product". It isn't a term I am familiar with, but I think I may have got it wrong and it should be "weighted prime sum". Apologies for introducing that error.

    Regards,
    --
    David Entwistle
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to rec.puzzles on Thu Aug 20 11:58:57 2026
    From Newsgroup: rec.puzzles

    David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> wrote or quoted:
    1. rCLWeighted prime productrCY: 2A + 3B + 5C + 7D = 111
    2. The 2-digit number AB is divisible by 3.

    WARNING: PARTIAL SPOILER FOLLOWS BELOW THE SPOILER SPACE BELOW

























































    It seems, one might get exactly one solution, if the last condition
    with the "9" is removed.

    import math
    for i in range( 1000, 10000 ): # A != 0
    A, B, C, D =[ int( i )for i in str( i )]
    # digits are distinct
    if A != B and A != B and A != D and B != C and B != D and C != D:
    # "Weighted prime product": 2A + 3B + 5C + 7D = 111
    if 2 * A + 3 * B + 5 * C + 7 * D == 111:
    # or 2 * 10 + A + 3 * 10 + B + 5 * 10 + C + 7 * 10 + D == 111:
    # The 2-digit number AB is divisible by 3
    if int( ( A * 10 + B )/ 3 )== ( A * 10 + B )/ 3:
    # The 2-digit number CD is divisible by 4
    if int( ( C * 10 + D )/ 4 )== ( C * 10 + D )/ 4:
    # gcd(AB,CD)=1
    if math.gcd(A * 10 + B,C * 10 + D)==1:
    # REMOVED: The 4-digit number ABCD is divisible by 9
    # if int( ( A * 1000 + B * 100 + C * 10 + D )/ 9 )==\
    # ( A * 1000 + B * 100 + C * 10 + D )/ 9:
    print( f"{A}{B}{C}{D}" )


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Entwistle@qnivq.ragjvfgyr@ogvagrearg.pbz to rec.puzzles on Thu Aug 20 15:32:08 2026
    From Newsgroup: rec.puzzles

    On Thu, 20 Aug 2026 12:51:34 GMT, James Dow Allen wrote:

    (Is "casting out nines" still taught in school?)

    I don't recall "casting out nines" was taught, here in the UK, even when I
    was at school from roughly 1964 - 1976. I don't think we were told the divisibility rule for three, either.

    Helen Abbott Merrill devotes a whole chapter to divisibility in
    Mathematical Excursions. It's a real pleasure to read such things and
    realize you may have been missing out on some basic knowledge for years.

    AI does seem rather certain of its opinions. Even after a sequence of four
    AI generated problems were completely unsolvable it still declared the
    final problem was verified. I think anyone would quickly tire of a human
    so sure of their dubious opinions - they'd almost certainly be a
    politician anyway...

    Hope the river levels stay safe.
    --
    David Entwistle
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Entwistle@qnivq.ragjvfgyr@ogvagrearg.pbz to rec.puzzles on Thu Aug 20 15:42:06 2026
    From Newsgroup: rec.puzzles

    On 20 Aug 2026 11:58:57 GMT, Stefan Ram wrote:

    It seems, one might get exactly one solution, if the last condition
    with the "9" is removed.

    Interesting. I haven't found a solution, but I make many mistakes. I think that would make the question:

    Find the unique 4-digit code ABCD where digits are distinct and A != 0,
    such that:

    1. rCLWeighted prime sumrCY: 2A + 3B + 5C + 7D = 111
    2. The 2-digit number AB is divisible by 3.
    3. The 2-digit number CD is divisible by 4.
    4. gcd(AB,CD)=1.


    Reply with the code ABCD.

    Best wishes,
    --
    David Entwistle
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Entwistle@qnivq.ragjvfgyr@ogvagrearg.pbz to rec.puzzles on Thu Aug 20 15:50:40 2026
    From Newsgroup: rec.puzzles

    On Thu, 20 Aug 2026 15:42:06 -0000 (UTC), David Entwistle wrote:

    1. rCLWeighted prime sumrCY: 2A + 3B + 5C + 7D = 111

    Ah yes, but there is one weighted prime sum for which there is an answer.
    I'm sure that was what Stefan was alluding to.

    Very nice.
    --
    David Entwistle
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Charlie Roberts@croberts@gmail.com to rec.puzzles on Sat Aug 22 13:05:08 2026
    From Newsgroup: rec.puzzles

    On Thu, 20 Aug 2026 15:32:08 -0000 (UTC), David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> wrote:

    On Thu, 20 Aug 2026 12:51:34 GMT, James Dow Allen wrote:

    (Is "casting out nines" still taught in school?)

    I don't recall "casting out nines" was taught, here in the UK, even when I >was at school from roughly 1964 - 1976. I don't think we were told the >divisibility rule for three, either.

    Very interesting. Having inherited the British system, in my school in
    India, we used Hall and Stevens for geometry and H. S. Hall (A School
    Algebra? for, of course, algebra). Somewhere in there were tests of divisibility. So the UK must have made considerable "progress" in
    culling "useless stuff" ;-)

    Ore Oystein's "Number Theory and its History" has an excellent
    chapter on tests of divisibility, including a great discussion of the
    recurring properties of 1/7.

    Helen Abbott Merrill devotes a whole chapter to divisibility in
    Mathematical Excursions. It's a real pleasure to read such things and >realize you may have been missing out on some basic knowledge for years.

    Thanks for this as I had not heard of this book till now. Will try to
    get it.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Phil Carmody@pc+usenet@asdf.org to rec.puzzles on Thu Aug 27 19:08:37 2026
    From Newsgroup: rec.puzzles

    David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> writes:
    On Thu, 20 Aug 2026 10:45:18 -0000 (UTC), David Entwistle wrote:

    think there is a solution for any given weighted prime product.

    1. rCLWeighted prime productrCY: 2A + 3B + 5C + 7D = 111

    I added the words "weighted prime product". It isn't a term I am familiar with, but I think I may have got it wrong and it should be "weighted prime sum". Apologies for introducing that error.

    prime-weighted sum is even clearer, I'd say.
    It's a weighted sum, and what are those weights - primes.

    Phil
    --
    We are no longer hunters and nomads. No longer awed and frightened, as we have gained some understanding of the world in which we live. As such, we can cast aside childish remnants from the dawn of our civilization.
    -- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Phil Carmody@pc+usenet@asdf.org to rec.puzzles on Thu Aug 27 22:37:05 2026
    From Newsgroup: rec.puzzles

    David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> writes:
    On Thu, 20 Aug 2026 12:51:34 GMT, James Dow Allen wrote:
    (Is "casting out nines" still taught in school?)

    I don't recall "casting out nines" was taught, here in the UK, even when I was at school from roughly 1964 - 1976. I don't think we were told the divisibility rule for three, either.

    We had casting out 9s in primary/middle school in the late 70s in London.

    Phil
    --
    We are no longer hunters and nomads. No longer awed and frightened, as we have gained some understanding of the world in which we live. As such, we can cast aside childish remnants from the dawn of our civilization.
    -- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/
    --- Synchronet 3.22a-Linux NewsLink 1.2