Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > rec.puzzles > #28018 > unrolled thread

Four Digit Code Problem

Started byDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
First post2026-08-20 10:45 +0000
Last post2026-08-27 22:37 +0300
Articles 10 — 5 participants

Back to article view | Back to rec.puzzles


Contents

  Four Digit Code Problem David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-20 10:45 +0000
    Re: Four Digit Code Problem David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-20 11:06 +0000
      Re: Four Digit Code Problem Phil Carmody <pc+usenet@asdf.org> - 2026-08-27 19:08 +0300
    Re: Four Digit Code Problem ram@zedat.fu-berlin.de (Stefan Ram) - 2026-08-20 11:58 +0000
      Re: Four Digit Code Problem David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-20 15:42 +0000
        Re: Four Digit Code Problem David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-20 15:50 +0000
    Re: Four Digit Code Problem James Dow Allen <user4353@newsgrouper.org.invalid> - 2026-08-20 12:51 +0000
      Re: Four Digit Code Problem David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> - 2026-08-20 15:32 +0000
        Re: Four Digit Code Problem Charlie Roberts <croberts@gmail.com> - 2026-08-22 13:05 -0400
        Re: Four Digit Code Problem Phil Carmody <pc+usenet@asdf.org> - 2026-08-27 22:37 +0300

#28018 — Four Digit Code Problem

FromDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
Date2026-08-20 10:45 +0000
SubjectFour Digit Code Problem
Message-ID<1166lru$3at5d$1@dont-email.me>
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. “Weighted prime product”: 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

[toc] | [next] | [standalone]


#28019

FromDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
Date2026-08-20 11:06 +0000
Message-ID<1166n3c$3e9a2$1@dont-email.me>
In reply to#28018
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. “Weighted prime product”: 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

[toc] | [prev] | [next] | [standalone]


#28043

FromPhil Carmody <pc+usenet@asdf.org>
Date2026-08-27 19:08 +0300
Message-ID<87fqzz4kca.fsf@asdf.ee>
In reply to#28019
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. “Weighted prime product”: 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/

[toc] | [prev] | [next] | [standalone]


#28020

Fromram@zedat.fu-berlin.de (Stefan Ram)
Date2026-08-20 11:58 +0000
Message-ID<code-20260820125200@ram.dialup.fu-berlin.de>
In reply to#28018
David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> wrote or quoted:
>    1. “Weighted prime product”: 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}" )

[toc] | [prev] | [next] | [standalone]


#28023

FromDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
Date2026-08-20 15:42 +0000
Message-ID<116778e$3ji05$2@dont-email.me>
In reply to#28020
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. “Weighted prime sum”: 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

[toc] | [prev] | [next] | [standalone]


#28024

FromDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
Date2026-08-20 15:50 +0000
Message-ID<11677og$3k60v$1@dont-email.me>
In reply to#28023
On Thu, 20 Aug 2026 15:42:06 -0000 (UTC), David Entwistle wrote:

>     1. “Weighted prime sum”: 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

[toc] | [prev] | [next] | [standalone]


#28021

FromJames Dow Allen <user4353@newsgrouper.org.invalid>
Date2026-08-20 12:51 +0000
Message-ID<1787230294-4353@newsgrouper.org>
In reply to#28018
David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> posted:

> It was raining, here in the UK, this morning

Rained today here in Chiang Mai but the Ping River is still well below cresting.
Nan Province has disastrous flooding, but from the Nan River rather than the Ping.
       https://www.youtube.com/shorts/M60tvPqKXSY
Although the video is labeled "2026", Fake News is so rampant everywhere
that that clip may come from the record-setting floods of 2025.

I didn't work on the puzzle other than noting that it's impossible!

Remark:
100*x + y cannot be divisible by 3 unless either BOTH x and y
are divisible by 3, or NEITHER is.  This fact is widely known.
(Is "casting out nines" still taught in school?)

>     2. The 2-digit number AB is divisible by 3.  
>     4. gcd(AB,CD)=1.

These two imply CD cannot be divisible by 3.
 
>     5. The 4-digit number ABCD is divisible by 9.

So this is ruled out by the Remark.

Again we see an AI make simple arithmetic errors and produce other nonsense.
The AI's "proving difficult conjectures" must be special symbolic math processors?


Cheers, James

[toc] | [prev] | [next] | [standalone]


#28022

FromDavid Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz>
Date2026-08-20 15:32 +0000
Message-ID<11676lo$3ji05$1@dont-email.me>
In reply to#28021
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

[toc] | [prev] | [next] | [standalone]


#28025

FromCharlie Roberts <croberts@gmail.com>
Date2026-08-22 13:05 -0400
Message-ID<4blj8l98pp5sa4eu1t89tklj8t2loi6uuu@4ax.com>
In reply to#28022
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.

[toc] | [prev] | [next] | [standalone]


#28044

FromPhil Carmody <pc+usenet@asdf.org>
Date2026-08-27 22:37 +0300
Message-ID<87bjan4aou.fsf@asdf.ee>
In reply to#28022
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/

[toc] | [prev] | [standalone]


Back to top | Article view | rec.puzzles


csiph-web