Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson


devel / comp.lang.forth / Re: test for repdigit - so called "Schnapszahl in German"

SubjectAuthor
* test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
+* Re: test for repdigit - so called "Schnapszahl in German"Zbig
|`- Re: test for repdigit - so called "Schnapszahl in German"Zbig
`* Re: test for repdigit - so called "Schnapszahl in German"Alexander Wegel
 `* Re: test for repdigit - so called "Schnapszahl in German"Alexander Wegel
  `* Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   +* Re: test for repdigit - so called "Schnapszahl in German"Zbig
   |`* Re: test for repdigit - so called "Schnapszahl in German"Zbig
   | +- Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   | `* Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   |  `* Re: test for repdigit - so called "Schnapszahl in German"Marcel Hendrix
   |   `* Re: test for repdigit - so called "Schnapszahl in German"dxforth
   |    `* Re: test for repdigit - so called "Schnapszahl in German"Marcel Hendrix
   |     `* Re: test for repdigit - so called "Schnapszahl in German"dxforth
   |      `* Re: test for repdigit - so called "Schnapszahl in German"Marcel Hendrix
   |       `- Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   +* Re: test for repdigit - so called "Schnapszahl in German"Gerry Jackson
   |+* Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   ||+* Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   |||`* Re: test for repdigit - so called "Schnapszahl in German"Gerry Jackson
   ||| `* Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   |||  +* Re: test for repdigit - so called "Schnapszahl in German"Marcel Hendrix
   |||  |`- Re: test for repdigit - so called "Schnapszahl in German"Marcel Hendrix
   |||  `- Re: test for repdigit - so called "Schnapszahl in German"Zbig
   ||`- Re: test for repdigit - so called "Schnapszahl in German"kuku@physik.rwth-aachen.de
   |`- Re: test for repdigit - so called "Schnapszahl in German"none
   `- Re: test for repdigit - so called "Schnapszahl in German"Alexander Wegel

Pages:12
test for repdigit - so called "Schnapszahl in German"

<af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18806&group=comp.lang.forth#18806

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1897:b0:31d:3f9e:d6de with SMTP id v23-20020a05622a189700b0031d3f9ed6demr1105728qtc.396.1656747641488;
Sat, 02 Jul 2022 00:40:41 -0700 (PDT)
X-Received: by 2002:a37:6394:0:b0:6ae:d8fc:a582 with SMTP id
x142-20020a376394000000b006aed8fca582mr13590564qkb.75.1656747641350; Sat, 02
Jul 2022 00:40:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 2 Jul 2022 00:40:41 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:9c32:beb:86ef:8d0;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:9c32:beb:86ef:8d0
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
Subject: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sat, 02 Jul 2022 07:40:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 16
 by: kuku@physik.rwth-aac - Sat, 2 Jul 2022 07:40 UTC

Probably because a drunken person may see double digits a repdigit number is called "Schnapszahl". Anyway, don't want to bother you with local peculiarities, instead give a weekend riddle: How do I test (most elegantly as always is a demand in FORTH :) whether a number consists of equal digits before being printed in the current base?

Idea behind is in what base the decimal numbers 42 and 80 are repdigit numbers?

The FORTH words I have so far are:

: b base ! . decimal ; ok

: t 81 2 do cr i ." base:" . ." 80 ->" 80 i b ." 42-> " 42 i b loop ;

Would be fine if FORTH could sort out the hits rather than the human eye.

Re: test for repdigit - so called "Schnapszahl in German"

<6a785ecb-a8fc-4548-9808-707a5b46afban@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18809&group=comp.lang.forth#18809

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:112a:b0:6af:1bb9:fb91 with SMTP id p10-20020a05620a112a00b006af1bb9fb91mr13603704qkk.229.1656765236499;
Sat, 02 Jul 2022 05:33:56 -0700 (PDT)
X-Received: by 2002:a05:622a:138b:b0:31d:4433:1175 with SMTP id
o11-20020a05622a138b00b0031d44331175mr481333qtk.25.1656765236301; Sat, 02 Jul
2022 05:33:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 2 Jul 2022 05:33:56 -0700 (PDT)
In-Reply-To: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6a785ecb-a8fc-4548-9808-707a5b46afban@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sat, 02 Jul 2022 12:33:56 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1317
 by: Zbig - Sat, 2 Jul 2022 12:33 UTC

: findBase 81 2 do i base ! dup base @ /mod = if ." Got it! Base: " base @ decimal . leave then loop drop decimal ;

Re: test for repdigit - so called "Schnapszahl in German"

<b7ce7f8f-05ee-45b8-bf28-ed0977160ddbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18810&group=comp.lang.forth#18810

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:8904:0:b0:6af:199b:bcb with SMTP id l4-20020a378904000000b006af199b0bcbmr14171828qkd.462.1656766483662;
Sat, 02 Jul 2022 05:54:43 -0700 (PDT)
X-Received: by 2002:ac8:5dcb:0:b0:31d:42c8:95d7 with SMTP id
e11-20020ac85dcb000000b0031d42c895d7mr727691qtx.546.1656766483534; Sat, 02
Jul 2022 05:54:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 2 Jul 2022 05:54:43 -0700 (PDT)
In-Reply-To: <6a785ecb-a8fc-4548-9808-707a5b46afban@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com> <6a785ecb-a8fc-4548-9808-707a5b46afban@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b7ce7f8f-05ee-45b8-bf28-ed0977160ddbn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sat, 02 Jul 2022 12:54:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 4
 by: Zbig - Sat, 2 Jul 2022 12:54 UTC

> : findBase 81 2 do i base ! dup base @ /mod = if ." Got it! Base: " base @ decimal . leave then loop drop decimal ;

OK, a little refined to limit memory access:
: findBase2 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . leave then loop drop ;
(and that closing "decimal" not needed as long as you'll search the numbers not larger than 80)

Re: test for repdigit - so called "Schnapszahl in German"

<1puh393.9yncoyz728w5N%awegel@arcor.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18813&group=comp.lang.forth#18813

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.freedyn.de!aioe.org!9ueilnawuYJG1AKkgsyQYQ.user.46.165.242.75.POSTED!not-for-mail
From: awe...@arcor.de (Alexander Wegel)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Sat, 2 Jul 2022 19:14:48 +0200
Organization: Aioe.org NNTP Server
Message-ID: <1puh393.9yncoyz728w5N%awegel@arcor.de>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="18394"; posting-host="9ueilnawuYJG1AKkgsyQYQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: MacSOUP/D-2.8.5 (ea919cf118) (Mac OS 10.14.6)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Alexander Wegel - Sat, 2 Jul 2022 17:14 UTC

kuku@physik.rwth-aachen.de <kuku@physik.rwth-aachen.de> wrote:

> Probably because a drunken person may see double digits a repdigit number is
> called "Schnapszahl". Anyway, don't want to bother you with local
> peculiarities, instead give a weekend riddle: How do I test (most elegantly
> as always is a demand in FORTH :) whether a number consists of equal digits
> before being printed in the current base?
>
> Idea behind is in what base the decimal numbers 42 and 80 are repdigit
> numbers?
>
> The FORTH words I have so far are:
>
> : b base ! . decimal ; ok
>
> : t 81 2 do cr i ." base:" . ." 80 ->" 80 i b ." 42-> " 42 i b loop ;
>
> Would be fine if FORTH could sort out the hits rather than the human eye.

The following detects Schnapszahlen having two places only (and gives
false results outside that range) for the sake of simplicity:

: ten base @ ;
: snaps? ten 1+ mod 0= ;

The thing to take home: a schnapszahl is a multiple of 11 in the current
number base.

cheers

Re: test for repdigit - so called "Schnapszahl in German"

<1puhc68.1l272nswknzb2N%awegel@arcor.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18814&group=comp.lang.forth#18814

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!9ueilnawuYJG1AKkgsyQYQ.user.46.165.242.75.POSTED!not-for-mail
From: awe...@arcor.de (Alexander Wegel)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Sat, 2 Jul 2022 19:18:19 +0200
Organization: Aioe.org NNTP Server
Message-ID: <1puhc68.1l272nswknzb2N%awegel@arcor.de>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com> <1puh393.9yncoyz728w5N%awegel@arcor.de>
Injection-Info: gioia.aioe.org; logging-data="21709"; posting-host="9ueilnawuYJG1AKkgsyQYQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: MacSOUP/D-2.8.5 (ea919cf118) (Mac OS 10.14.6)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Alexander Wegel - Sat, 2 Jul 2022 17:18 UTC

Alexander Wegel <awegel@arcor.de> wrote:

> The thing to take home: a schnapszahl is a multiple of 11 in the current
> number base.

Anyway, it's just the same principle as in zbigs code 8-)

Re: test for repdigit - so called "Schnapszahl in German"

<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18828&group=comp.lang.forth#18828

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:9a0c:0:b0:470:54d7:cfd5 with SMTP id p12-20020a0c9a0c000000b0047054d7cfd5mr24757322qvd.46.1656833175212;
Sun, 03 Jul 2022 00:26:15 -0700 (PDT)
X-Received: by 2002:a05:622a:647:b0:31d:2a37:1adf with SMTP id
a7-20020a05622a064700b0031d2a371adfmr16017324qtb.328.1656833174053; Sun, 03
Jul 2022 00:26:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 00:26:13 -0700 (PDT)
In-Reply-To: <1puhc68.1l272nswknzb2N%awegel@arcor.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 07:26:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 31
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 07:26 UTC

Alexander Wegel schrieb am Samstag, 2. Juli 2022 um 19:18:21 UTC+2:
> Alexander Wegel <awe...@arcor.de> wrote:
>
> > The thing to take home: a schnapszahl is a multiple of 11 in the current
> > number base.
> Anyway, it's just the same principle as in zbigs code 8-)

Alexander, thanks for the "multiple of 11" remark, but doesn't help in the problem solution.
One could extend the rule to 111 for 3 digit results and so on.

@Zbig: the problem to solve is: name all bases in which the given number (80,42) is a repdigit number.
For the 80, the result should be:

80
base number
3 2222
9 22
19 44
39 22
79 11

Your algorithm finds the 9 (only)

42
base number
4 222
13 33
20 22
41 11

Re: test for repdigit - so called "Schnapszahl in German"

<c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18829&group=comp.lang.forth#18829

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:20f:b0:31d:47ea:43a5 with SMTP id b15-20020a05622a020f00b0031d47ea43a5mr1958536qtx.257.1656834441000;
Sun, 03 Jul 2022 00:47:21 -0700 (PDT)
X-Received: by 2002:a05:622a:551:b0:31d:425c:fb8e with SMTP id
m17-20020a05622a055100b0031d425cfb8emr3781766qtx.478.1656834440765; Sun, 03
Jul 2022 00:47:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 00:47:20 -0700 (PDT)
In-Reply-To: <aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sun, 03 Jul 2022 07:47:20 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Zbig - Sun, 3 Jul 2022 07:47 UTC

> @Zbig: the problem to solve is: name all bases in which the given number (80,42) is a repdigit number.

No, that ("all bases") wasn't present in the conditions.

> For the 80, the result should be:
>
> 80
> base number
> 3 2222
> 9 22
> 19 44
> 39 22
> 79 11
>
> Your algorithm finds the 9 (only)

You can simply remove "leave" word -- or (even better) replace it with "cr".
As for the schnapsen with more than two digits: it's doable, but I think it
would need some recursive algorithm.

Re: test for repdigit - so called "Schnapszahl in German"

<t9rhlk$2uh87$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18830&group=comp.lang.forth#18830

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: do-not-...@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Sun, 3 Jul 2022 08:49:09 +0100
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <t9rhlk$2uh87$1@dont-email.me>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de>
<1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 3 Jul 2022 07:49:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c5375d5636a799a8d891be191c46c96b";
logging-data="3097863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Cbco0Ld4hssUDqegWx2N/p3dKuURcsL8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:SH4AC6+SCfg2x6cCZk2vNe2uwE4=
In-Reply-To: <aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
 by: Gerry Jackson - Sun, 3 Jul 2022 07:49 UTC

On 03/07/2022 08:26, kuku@physik.rwth-aachen.de wrote:
> Alexander Wegel schrieb am Samstag, 2. Juli 2022 um 19:18:21 UTC+2:
>> Alexander Wegel <awe...@arcor.de> wrote:
>>
>>> The thing to take home: a schnapszahl is a multiple of 11 in the current
>>> number base.
>> Anyway, it's just the same principle as in zbigs code 8-)
>
> Alexander, thanks for the "multiple of 11" remark, but doesn't help in the problem solution.
> One could extend the rule to 111 for 3 digit results and so on.
>
> @Zbig: the problem to solve is: name all bases in which the given number (80,42) is a repdigit number.
> For the 80, the result should be:
>
> 80
> base number
> 3 2222
> 9 22

22 in base 9 is decimal 20

> 19 44
> 39 22
> 79 11
>
> Your algorithm finds the 9 (only)
>
>
> 42
> base number
> 4 222
> 13 33
> 20 22
> 41 11: divisor ( #digits -- n-ones ) 0 tuck ?do base @ * 1+ loop ;

\ Extending Alexander Wegel's idea to 11...1, in bases 2 to 36 ANS max
\ base

: #digits ( ud -- #digs ) <# #s #> nip ;

: repdigit? ( ud -- f )
2dup #digits dup 2 < if drop nip exit then
divisor sm/rem drop 0=
;

: report ( n f -- )
0= if drop exit then
base @ >r decimal cr ." Base: " r@ 2 .r
." , Number: #" dup 0 .r
r> base ! ." , Repdigit: " .
;

: repdigit ( n -- )
dup 0 ( -- n ud )
37 2
do
i base ! 2>r
2r@ repdigit? ( -- n f )
over swap report 2r> ( -- n ud )
loop 2drop drop decimal
;

#42 repdigit cr
Base: 4, Number: #42, Repdigit: 222
Base: 13, Number: #42, Repdigit: 33
Base: 20, Number: #42, Repdigit: 22 ok

#80 repdigit
Base: 3, Number: #80, Repdigit: 2222
Base: 9, Number: #80, Repdigit: 88
Base: 15, Number: #80, Repdigit: 55
Base: 19, Number: #80, Repdigit: 44 ok

--
Gerry

Re: test for repdigit - so called "Schnapszahl in German"

<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18831&group=comp.lang.forth#18831

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:c204:0:b0:6af:3a2:4a20 with SMTP id i4-20020a37c204000000b006af03a24a20mr16815250qkm.706.1656836073566;
Sun, 03 Jul 2022 01:14:33 -0700 (PDT)
X-Received: by 2002:a05:622a:190d:b0:31d:2ac7:9dc2 with SMTP id
w13-20020a05622a190d00b0031d2ac79dc2mr16072376qtc.233.1656836073434; Sun, 03
Jul 2022 01:14:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:14:33 -0700 (PDT)
In-Reply-To: <t9rhlk$2uh87$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 08:14:33 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 25
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 08:14 UTC

Gerry Jackson schrieb am Sonntag, 3. Juli 2022 um 09:49:10 UTC+2:
> On 03/07/2022 08:26, ku...@physik.rwth-aachen.de wrote:
> > Alexander Wegel schrieb am Samstag, 2. Juli 2022 um 19:18:21 UTC+2:
> >> Alexander Wegel <awe...@arcor.de> wrote:
> >>
> >>> The thing to take home: a schnapszahl is a multiple of 11 in the current
> >>> number base.
> >> Anyway, it's just the same principle as in zbigs code 8-)
> >
> > Alexander, thanks for the "multiple of 11" remark, but doesn't help in the problem solution.
> > One could extend the rule to 111 for 3 digit results and so on.
> >
> > @Zbig: the problem to solve is: name all bases in which the given number (80,42) is a repdigit number.
> > For the 80, the result should be:
> >
> > 80
> > base number
> > 3 2222
> > 9 22
> 22 in base 9 is decimal 20

Sorry, this meant to be 9 88. One more reason to let FORTH do the job and then copy/paste :)

Re: test for repdigit - so called "Schnapszahl in German"

<38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18833&group=comp.lang.forth#18833

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:c4a:b0:470:a4f6:e66d with SMTP id r10-20020a0562140c4a00b00470a4f6e66dmr24171976qvj.116.1656836832050;
Sun, 03 Jul 2022 01:27:12 -0700 (PDT)
X-Received: by 2002:ac8:5c08:0:b0:317:e856:bcff with SMTP id
i8-20020ac85c08000000b00317e856bcffmr19753434qti.615.1656836831916; Sun, 03
Jul 2022 01:27:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:27:11 -0700 (PDT)
In-Reply-To: <eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 08:27:12 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 08:27 UTC

kuku@physik.rwth-aachen.de schrieb am Sonntag, 3. Juli 2022 um 10:14:34 UTC+2:
> Gerry Jackson schrieb am Sonntag, 3. Juli 2022 um 09:49:10 UTC+2:

Nice solution, Gerry. Only solutions
80:
base number
39 22
79 11
are missing.

Re: test for repdigit - so called "Schnapszahl in German"

<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18834&group=comp.lang.forth#18834

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:215:b0:31d:36f7:ece8 with SMTP id b21-20020a05622a021500b0031d36f7ece8mr10065261qtx.187.1656836882131;
Sun, 03 Jul 2022 01:28:02 -0700 (PDT)
X-Received: by 2002:a05:622a:48f:b0:31d:396d:e55 with SMTP id
p15-20020a05622a048f00b0031d396d0e55mr9047680qtx.376.1656836881998; Sun, 03
Jul 2022 01:28:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:28:01 -0700 (PDT)
In-Reply-To: <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sun, 03 Jul 2022 08:28:02 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: Zbig - Sun, 3 Jul 2022 08:28 UTC

> You can simply remove "leave" word -- or (even better) replace it with "cr".
> As for the schnapsen with more than two digits: it's doable, but I think it
> would need some recursive algorithm.

Uh, I forgot: in such case we also need to insert "decimal" at the end back.
So to sum up it'll look like this:

: findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;
80 findbase2 Got it! Base: 9
Got it! Base: 15
Got it! Base: 19
Got it! Base: 39
Got it! Base: 79
It found even more for 80, than you expected. :)

Re: test for repdigit - so called "Schnapszahl in German"

<c671697d-1735-4321-bbed-0c03f908a9edn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18835&group=comp.lang.forth#18835

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4843:b0:6ae:e906:ea49 with SMTP id ec3-20020a05620a484300b006aee906ea49mr16106089qkb.744.1656837069991;
Sun, 03 Jul 2022 01:31:09 -0700 (PDT)
X-Received: by 2002:a05:620a:4103:b0:6b2:563a:25a2 with SMTP id
j3-20020a05620a410300b006b2563a25a2mr7873996qko.185.1656837069856; Sun, 03
Jul 2022 01:31:09 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:31:09 -0700 (PDT)
In-Reply-To: <eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c671697d-1735-4321-bbed-0c03f908a9edn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 08:31:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 08:31 UTC

kuku@physik.rwth-aachen.de schrieb am Sonntag, 3. Juli 2022 um 10:14:34 UTC+2:
> Gerry Jackson schrieb am Sonntag, 3. Juli 2022 um 09:49:10 UTC+2:
But ok, extending

: repdigit ( n -- )
dup 0 ( -- n ud )
80 2
do
i base ! 2>r compiled
over swap report 2r> ( -- n ud )
loop 2drop drop decimal ;

Re: test for repdigit - so called "Schnapszahl in German"

<def2b97f-d768-423b-ab21-ed13d36f947cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18836&group=comp.lang.forth#18836

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:4454:0:b0:69f:c339:e2dc with SMTP id r81-20020a374454000000b0069fc339e2dcmr16178857qka.771.1656837326618;
Sun, 03 Jul 2022 01:35:26 -0700 (PDT)
X-Received: by 2002:a05:622a:1816:b0:31d:31de:db34 with SMTP id
t22-20020a05622a181600b0031d31dedb34mr14198408qtc.588.1656837326483; Sun, 03
Jul 2022 01:35:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:35:26 -0700 (PDT)
In-Reply-To: <2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <def2b97f-d768-423b-ab21-ed13d36f947cn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 08:35:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 08:35 UTC

Zbig schrieb am Sonntag, 3. Juli 2022 um 10:28:02 UTC+2:
....
> : findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;
> 80 findbase2 Got it! Base: 9
> Got it! Base: 15
> Got it! Base: 19
> Got it! Base: 39
> Got it! Base: 79
> It found even more for 80, than you expected. :)

Re: test for repdigit - so called "Schnapszahl in German"

<e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18837&group=comp.lang.forth#18837

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1909:b0:31b:f611:8115 with SMTP id w9-20020a05622a190900b0031bf6118115mr19771666qtc.345.1656837463168;
Sun, 03 Jul 2022 01:37:43 -0700 (PDT)
X-Received: by 2002:a05:620a:450c:b0:6b2:59b8:985 with SMTP id
t12-20020a05620a450c00b006b259b80985mr7399489qkp.328.1656837463028; Sun, 03
Jul 2022 01:37:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 01:37:42 -0700 (PDT)
In-Reply-To: <2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:71c2:7557:61e:7eeb;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:71c2:7557:61e:7eeb
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 08:37:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 11
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 08:37 UTC

Zbig schrieb am Sonntag, 3. Juli 2022 um 10:28:02 UTC+2:
....
> : findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;
> 80 findbase2 Got it! Base: 9
> Got it! Base: 15
> Got it! Base: 19
> Got it! Base: 39
> Got it! Base: 79
> It found even more for 80, than you expected. :)

My first approach liested them all, but as said, the human eye is the weak link in the chain of recognition.

Re: test for repdigit - so called "Schnapszahl in German"

<t9roe3$302mj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18838&group=comp.lang.forth#18838

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: do-not-...@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Sun, 3 Jul 2022 10:44:38 +0100
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <t9roe3$302mj$1@dont-email.me>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de>
<1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
<t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com>
<38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 3 Jul 2022 09:44:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="09d63c2f0cd8c8fec20a17b21518e948";
logging-data="3148499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+knU69SdAIdzQn7Pbu1AUAXPM1jNrfkCo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:anTJwIa4gbet9SOe8gJgzC0otWg=
In-Reply-To: <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
 by: Gerry Jackson - Sun, 3 Jul 2022 09:44 UTC

On 03/07/2022 09:27, kuku@physik.rwth-aachen.de wrote:
> kuku@physik.rwth-aachen.de schrieb am Sonntag, 3. Juli 2022 um 10:14:34 UTC+2:
>> Gerry Jackson schrieb am Sonntag, 3. Juli 2022 um 09:49:10 UTC+2:
>
> Nice solution, Gerry. Only solutions
> 80:
> base number
> 39 22
> 79 11
> are missing.

THe Forth I use only goes up to base 36

--
Gerry

Re: test for repdigit - so called "Schnapszahl in German"

<1puipm5.5v3kxs21ufmjN%awegel@arcor.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18842&group=comp.lang.forth#18842

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!9ueilnawuYJG1AKkgsyQYQ.user.46.165.242.75.POSTED!not-for-mail
From: awe...@arcor.de (Alexander Wegel)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Sun, 3 Jul 2022 13:06:56 +0200
Organization: Aioe.org NNTP Server
Message-ID: <1puipm5.5v3kxs21ufmjN%awegel@arcor.de>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com> <1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de> <aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="14999"; posting-host="9ueilnawuYJG1AKkgsyQYQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: MacSOUP/D-2.8.5 (ea919cf118) (Mac OS 10.14.6)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Alexander Wegel - Sun, 3 Jul 2022 11:06 UTC

kuku@physik.rwth-aachen.de <kuku@physik.rwth-aachen.de> wrote:

> Alexander Wegel schrieb am Samstag, 2. Juli 2022 um 19:18:21 UTC+2:
> > Alexander Wegel <awe...@arcor.de> wrote:
> >
> > > The thing to take home: a schnapszahl is a multiple of 11 in the current
> > > number base.
> > Anyway, it's just the same principle as in zbigs code 8-)
>
> Alexander, thanks for the "multiple of 11" remark, but doesn't help in the
> problem solution.
> One could extend the rule to 111 for 3 digit results and so on.

Yes, i was confused by your mentioning of "double digits", which are
apparently not part of the problem posed.

Re: test for repdigit - so called "Schnapszahl in German"

<d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18843&group=comp.lang.forth#18843

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5bc7:0:b0:470:4d3b:2cea with SMTP id t7-20020ad45bc7000000b004704d3b2ceamr23490251qvt.38.1656846575033;
Sun, 03 Jul 2022 04:09:35 -0700 (PDT)
X-Received: by 2002:ac8:5dcb:0:b0:31d:42c8:95d7 with SMTP id
e11-20020ac85dcb000000b0031d42c895d7mr3910441qtx.546.1656846574875; Sun, 03
Jul 2022 04:09:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 04:09:34 -0700 (PDT)
In-Reply-To: <t9roe3$302mj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:e3:2700:5600:f84d:ca98:61b0:654b;
posting-account=PFpM6wkAAAAQLqwaaW6fT6Z2FjRrHWrg
NNTP-Posting-Host: 2003:e3:2700:5600:f84d:ca98:61b0:654b
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com> <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
<t9roe3$302mj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: kuk...@physik.rwth-aachen.de (kuku@physik.rwth-aachen.de)
Injection-Date: Sun, 03 Jul 2022 11:09:35 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1847
 by: kuku@physik.rwth-aac - Sun, 3 Jul 2022 11:09 UTC

@Zbig:
Your
: findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;

doesn't find Base 3 2222 as the result.

BTW, my problem outline was :
"Idea behind is in what base the decimal numbers 42 and 80 are repdigit numbers? "

I think, this implies "all bases".

Re: test for repdigit - so called "Schnapszahl in German"

<cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18844&group=comp.lang.forth#18844

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:2f86:0:b0:6af:4c8c:ee8b with SMTP id v128-20020a372f86000000b006af4c8cee8bmr16565986qkh.633.1656846648133;
Sun, 03 Jul 2022 04:10:48 -0700 (PDT)
X-Received: by 2002:a05:620a:10a1:b0:6ae:ea6e:4097 with SMTP id
h1-20020a05620a10a100b006aeea6e4097mr16852862qkk.588.1656846648007; Sun, 03
Jul 2022 04:10:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 04:10:47 -0700 (PDT)
In-Reply-To: <e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:fd44:3996:8f9b:355a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:fd44:3996:8f9b:355a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com> <e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 03 Jul 2022 11:10:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2660
 by: Marcel Hendrix - Sun, 3 Jul 2022 11:10 UTC

On Sunday, July 3, 2022 at 10:37:44 AM UTC+2, kuku@physik.rwth-aachen.de wrote:
> Zbig schrieb am Sonntag, 3. Juli 2022 um 10:28:02 UTC+2:
> ...
> > : findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;
> > 80 findbase2 Got it! Base: 9
> > Got it! Base: 15
> > Got it! Base: 19
> > Got it! Base: 39
> > Got it! Base: 79
> > It found even more for 80, than you expected. :)
> My first approach liested them all, but as said, the human eye is the weak link in the chain of recognition.

I had no time for a simple solution.

: same? ( c-addr u -- f )
DUP 1 = IF 2DROP FALSE EXIT ENDIF
over C@ >S 1 /STRING
0 ?DO C@+ S
<> IF DROP -S FALSE UNLOOP EXIT
ENDIF
LOOP
DROP -S TRUE ;

: ?. ( u -- ) dup (.) same? IF . ELSE DROP ENDIF ;

: .solutions ( n1 -- )
>S BASE @
#81 2 DO I BASE !
S (.) same? IF CR BASE @ DEC. S ?. ENDIF
LOOP
BASE ! -S ;

FORTH> 42 .solutions
4 222
13 33
20 22
41 11 ok
FORTH> 80 .solutions
3 2222
9 88
15 55
19 44
39 22
79 11 ok
FORTH>

-marcel

Re: test for repdigit - so called "Schnapszahl in German"

<24ec4e7c-cac5-488c-9805-375af568772an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18846&group=comp.lang.forth#18846

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:a245:0:b0:6ae:de8e:9daf with SMTP id l66-20020a37a245000000b006aede8e9dafmr16547183qke.527.1656847350413;
Sun, 03 Jul 2022 04:22:30 -0700 (PDT)
X-Received: by 2002:a05:6214:21e1:b0:472:efb7:ff0f with SMTP id
p1-20020a05621421e100b00472efb7ff0fmr3420166qvj.68.1656847350123; Sun, 03 Jul
2022 04:22:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 04:22:29 -0700 (PDT)
In-Reply-To: <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:fd44:3996:8f9b:355a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:fd44:3996:8f9b:355a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com> <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
<t9roe3$302mj$1@dont-email.me> <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <24ec4e7c-cac5-488c-9805-375af568772an@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 03 Jul 2022 11:22:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3227
 by: Marcel Hendrix - Sun, 3 Jul 2022 11:22 UTC

On Sunday, July 3, 2022 at 1:09:36 PM UTC+2, kuku@physik.rwth-aachen.de wrote:
[..]
> BTW, my problem outline was :
> "Idea behind is in what base the decimal numbers 42 and 80 are repdigit numbers? "
> I think, this implies "all bases".

What's so special about 42 and 80?

FORTH> : test #81 1 do i .solutions loop ; ok
FORTH> test
2 11
3 11
4 11
5 11
2 111
6 11
3 22
7 11
8 11
4 22
9 11
10 11
5 22
11 11
3 111
12 11
6 22
13 11
2 1111
4 33
14 11
7 22
15 11
16 11
5 33
8 22
17 11
18 11
9 22
19 11
4 111
6 33
20 11
10 22
21 11
22 11
5 44
7 33
11 22
23 11
24 11
3 222
12 22
25 11
8 33
26 11
6 44
13 22
27 11
28 11
9 33
14 22
29 11
2 11111
5 111
30 11
7 44
15 22
31 11
10 33
32 11
16 22
33 11
6 55
34 11
8 44
11 33
17 22
35 11
36 11
18 22
37 11
12 33
38 11
3 1111
7 55
9 44
19 22
39 11
40 11
4 222
13 33
20 22
41 11
6 111
42 11
10 44
21 22
43 11
8 55
14 33
44 11
22 22
45 11
46 11
7 66
11 44
15 33
23 22
47 11
48 11
9 55
24 22
49 11
16 33
50 11
12 44
25 22
51 11
52 11
8 66
17 33
26 22
53 11
10 55
54 11
13 44
27 22
55 11
7 111
18 33
56 11
28 22
57 11
58 11
9 66
11 55
14 44
19 33
29 22
59 11
60 11
5 222
30 22
61 11
2 111111
4 333
8 77
20 33
62 11
15 44
31 22
63 11
12 55
64 11
10 66
21 33
32 22
65 11
66 11
16 44
33 22
67 11
22 33
68 11
9 77
13 55
34 22
69 11
70 11
11 66
17 44
23 33
35 22
71 11
8 111
72 11
36 22
73 11
14 55
24 33
74 11
18 44
37 22
75 11
10 77
76 11
12 66
25 33
38 22
77 11
78 11
3 2222
9 88
15 55
19 44
39 22
79 11 ok
FORTH>

-marcel

Re: test for repdigit - so called "Schnapszahl in German"

<27eba109-36e7-42ea-9745-8e8d278bcf00n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18847&group=comp.lang.forth#18847

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:9dc5:0:b0:6b2:4cf9:86dc with SMTP id g188-20020a379dc5000000b006b24cf986dcmr11138699qke.747.1656847795058;
Sun, 03 Jul 2022 04:29:55 -0700 (PDT)
X-Received: by 2002:a05:620a:400f:b0:6af:53bc:7311 with SMTP id
h15-20020a05620a400f00b006af53bc7311mr16755890qko.305.1656847794933; Sun, 03
Jul 2022 04:29:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 04:29:54 -0700 (PDT)
In-Reply-To: <24ec4e7c-cac5-488c-9805-375af568772an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:fd44:3996:8f9b:355a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:fd44:3996:8f9b:355a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com> <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
<t9roe3$302mj$1@dont-email.me> <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
<24ec4e7c-cac5-488c-9805-375af568772an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <27eba109-36e7-42ea-9745-8e8d278bcf00n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 03 Jul 2022 11:29:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2196
 by: Marcel Hendrix - Sun, 3 Jul 2022 11:29 UTC

On Sunday, July 3, 2022 at 1:22:31 PM UTC+2, Marcel Hendrix wrote:
> On Sunday, July 3, 2022 at 1:09:36 PM UTC+2, ku...@physik.rwth-aachen.de wrote:
> [..]
> > BTW, my problem outline was :
> > "Idea behind is in what base the decimal numbers 42 and 80 are repdigit numbers? "
> > I think, this implies "all bases".
> What's so special about 42 and 80?
>
> FORTH> : test #81 1 do i .solutions loop ; ok
> FORTH> test
[..]

60 is special in that it has the most schnappses.
testing with ** 60 **
9 66
11 55
14 44
19 33
29 22
59 11

-marcel

Re: test for repdigit - so called "Schnapszahl in German"

<0bf27a92-9196-4903-b4fc-ac70c2f6d0e0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18853&group=comp.lang.forth#18853

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:f:b0:31d:314c:f396 with SMTP id x15-20020a05622a000f00b0031d314cf396mr15037554qtw.191.1656859849591;
Sun, 03 Jul 2022 07:50:49 -0700 (PDT)
X-Received: by 2002:a05:622a:551:b0:31d:425c:fb8e with SMTP id
m17-20020a05622a055100b0031d425cfb8emr4860844qtx.478.1656859849370; Sun, 03
Jul 2022 07:50:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 07:50:49 -0700 (PDT)
In-Reply-To: <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <t9rhlk$2uh87$1@dont-email.me>
<eec130c5-cd26-4fbf-9847-0d666e55ae94n@googlegroups.com> <38130c1a-0d68-46c1-8fd6-83f1870226b7n@googlegroups.com>
<t9roe3$302mj$1@dont-email.me> <d1e05ce2-6715-4af8-871f-5f30e4004c5fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0bf27a92-9196-4903-b4fc-ac70c2f6d0e0n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sun, 03 Jul 2022 14:50:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2788
 by: Zbig - Sun, 3 Jul 2022 14:50 UTC

> : findBase 81 2 do base dup i swap ! @ over swap /mod = if ." Got it! Base: " i decimal . cr then loop drop decimal ;
> doesn't find Base 3 2222 as the result.
>
> BTW, my problem outline was :
> "Idea behind is in what base the decimal numbers 42 and 80 are repdigit numbers? "
> I think, this implies "all bases".
No, it doesn't; it says: "find a base meeting a condition ... " (not "find all possible bases
in the range ... ").
So you don't want to follow the path and complete it by yourself?
OK, have a solution then; it's somewhat crude, but we've got Sunday in Poland today, you know:

variable wrong
0 wrong !
: num2str abs 0 <# #s swap #> ;
: checkIt over c@ -rot 0 do dup i + c@ >r over r> = 0= if 1 wrong ! leave then loop 2drop ;
: findBases cr 81 min dup 2 do base i swap ! dup num2str checkIt wrong @ 0= if decimal ." Schapps at the base " i . cr then 0 wrong ! loop drop decimal ;

The test:

80 findBases
Schapps at the base 3
Schapps at the base 9
Schapps at the base 15
Schapps at the base 19
Schapps at the base 39
Schapps at the base 79

42 findBases
Schapps at the base 4
Schapps at the base 13
Schapps at the base 20
Schapps at the base 41

Re: test for repdigit - so called "Schnapszahl in German"

<t9sbak$3q6$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18856&group=comp.lang.forth#18856

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Mon, 4 Jul 2022 01:07:00 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t9sbak$3q6$1@gioia.aioe.org>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de>
<1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
<c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
<e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
<cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="3910"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 3 Jul 2022 15:07 UTC

On 3/07/2022 21:10, Marcel Hendrix wrote:
>
> I had no time for a simple solution.
>
> : same? ( c-addr u -- f )
> DUP 1 = IF 2DROP FALSE EXIT ENDIF
> over C@ >S 1 /STRING
> 0 ?DO C@+ S
> <> IF DROP -S FALSE UNLOOP EXIT
> ENDIF
> LOOP
> DROP -S TRUE ;
>
> : .solutions ( n1 -- )
> >S BASE @
> #81 2 DO I BASE !
> S (.) same? IF CR BASE @ DEC. S ?. ENDIF
> LOOP
> BASE ! -S ;

: same? ( c-addr u -- f )
DUP 1 > IF
OVER C@ >R 1 /STRING
R> SKIP 0= NIP EXIT
THEN 2DROP FALSE ;

: .solutions ( n1 -- )
BASE @ SWAP
81 2 DO I BASE !
DUP (.) same? IF CR I DEC. DUP ?. THEN
LOOP DROP BASE ! ;

Re: test for repdigit - so called "Schnapszahl in German"

<a0aa78e3-c02a-4c78-83b2-d94342a30d85n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18861&group=comp.lang.forth#18861

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5cc3:0:b0:470:46fd:7246 with SMTP id iu3-20020ad45cc3000000b0047046fd7246mr26124364qvb.70.1656865466467;
Sun, 03 Jul 2022 09:24:26 -0700 (PDT)
X-Received: by 2002:a05:622a:1ba5:b0:317:c65b:3ad1 with SMTP id
bp37-20020a05622a1ba500b00317c65b3ad1mr20909539qtb.117.1656865466304; Sun, 03
Jul 2022 09:24:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 09:24:26 -0700 (PDT)
In-Reply-To: <t9sbak$3q6$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:fd44:3996:8f9b:355a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:fd44:3996:8f9b:355a
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com> <e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
<cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com> <t9sbak$3q6$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a0aa78e3-c02a-4c78-83b2-d94342a30d85n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 03 Jul 2022 16:24:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1905
 by: Marcel Hendrix - Sun, 3 Jul 2022 16:24 UTC

On Sunday, July 3, 2022 at 5:07:03 PM UTC+2, dxforth wrote:
[..]
> : same? ( c-addr u -- f )
> DUP 1 > IF
> OVER C@ >R 1 /STRING
> R> SKIP 0= NIP EXIT
> THEN 2DROP FALSE ;

What if there are n (>2) digits and less than n are different?
Or are you prepared to spend a day proving that that is
not possible :--?

-marcel

Re: test for repdigit - so called "Schnapszahl in German"

<t9tjgi$u0d$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18867&group=comp.lang.forth#18867

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: test for repdigit - so called "Schnapszahl in German"
Date: Mon, 4 Jul 2022 12:32:48 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t9tjgi$u0d$1@gioia.aioe.org>
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de>
<1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com>
<c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com>
<e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
<cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com>
<t9sbak$3q6$1@gioia.aioe.org>
<a0aa78e3-c02a-4c78-83b2-d94342a30d85n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30733"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 4 Jul 2022 02:32 UTC

On 4/07/2022 02:24, Marcel Hendrix wrote:
> On Sunday, July 3, 2022 at 5:07:03 PM UTC+2, dxforth wrote:
> [..]
>> : same? ( c-addr u -- f )
>> DUP 1 > IF
>> OVER C@ >R 1 /STRING
>> R> SKIP 0= NIP EXIT
>> THEN 2DROP FALSE ;
>
> What if there are n (>2) digits and less than n are different?
> Or are you prepared to spend a day proving that that is
> not possible :--?

It demonstrates what's possible without much effort. Are you
saying it produces results different from yours?

Re: test for repdigit - so called "Schnapszahl in German"

<8cc79a9a-d850-4d82-ba31-17c7bd735c39n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18870&group=comp.lang.forth#18870

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:62e:b0:470:4608:1801 with SMTP id a14-20020a056214062e00b0047046081801mr26146134qvx.54.1656911812903;
Sun, 03 Jul 2022 22:16:52 -0700 (PDT)
X-Received: by 2002:ac8:5991:0:b0:31d:2bfb:f089 with SMTP id
e17-20020ac85991000000b0031d2bfbf089mr17954728qte.663.1656911812734; Sun, 03
Jul 2022 22:16:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 3 Jul 2022 22:16:52 -0700 (PDT)
In-Reply-To: <t9tjgi$u0d$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:11c0:f101:174f:3962;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:11c0:f101:174f:3962
References: <af404905-4a8a-4acc-a304-cd7a0e503298n@googlegroups.com>
<1puh393.9yncoyz728w5N%awegel@arcor.de> <1puhc68.1l272nswknzb2N%awegel@arcor.de>
<aea6b03d-a049-4d57-86a6-32e805719812n@googlegroups.com> <c829a923-0a7f-4bf5-9315-0c7ff93031e4n@googlegroups.com>
<2c0d7384-ea6f-4618-82ad-f05e0c9e73ffn@googlegroups.com> <e1f6c067-c538-4813-82a7-8cd48c2a5581n@googlegroups.com>
<cc3d22c5-7026-471b-a5a7-5a0db1908c0bn@googlegroups.com> <t9sbak$3q6$1@gioia.aioe.org>
<a0aa78e3-c02a-4c78-83b2-d94342a30d85n@googlegroups.com> <t9tjgi$u0d$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8cc79a9a-d850-4d82-ba31-17c7bd735c39n@googlegroups.com>
Subject: Re: test for repdigit - so called "Schnapszahl in German"
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Mon, 04 Jul 2022 05:16:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2436
 by: Marcel Hendrix - Mon, 4 Jul 2022 05:16 UTC

On Monday, July 4, 2022 at 4:32:54 AM UTC+2, dxforth wrote:
> On 4/07/2022 02:24, Marcel Hendrix wrote:
> > On Sunday, July 3, 2022 at 5:07:03 PM UTC+2, dxforth wrote:
> > [..]
> >> : same? ( c-addr u -- f )
> >> DUP 1 > IF
> >> OVER C@ >R 1 /STRING
> >> R> SKIP 0= NIP EXIT
> >> THEN 2DROP FALSE ;
> >
> > What if there are n (>2) digits and less than n are different?
> > Or are you prepared to spend a day proving that that is
> > not possible :--?
> It demonstrates what's possible without much effort. Are you
> saying it produces results different from yours?

I'm sorry! I see now you have inverted the exit test and then
SKIP is indeed possible. I didn't think enough about it and
used the ugly LOOP with all its administrative problems.

-marcel


devel / comp.lang.forth / Re: test for repdigit - so called "Schnapszahl in German"

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor