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


Groups > comp.programming > #11742 > unrolled thread

C o m p e t i t i o n .

Started byI I <he12457@hotmail.com>
First post2021-01-09 11:25 -0800
Last post2021-01-17 18:43 +0000
Articles 3 on this page of 23 — 9 participants

Back to article view | Back to comp.programming


Contents

  C o m p e t i t i o n . I I <he12457@hotmail.com> - 2021-01-09 11:25 -0800
    Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-10 09:21 +0000
      Re: C o m p e t i t i o n . I I <he12457@hotmail.com> - 2021-01-10 12:01 -0800
        Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-10 22:15 +0000
          Re: C o m p e t i t i o n . I I <kpuctjanpobam@mail.com> - 2021-01-12 05:17 -0800
            Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-12 16:16 +0000
              Re: C o m p e t i t i o n . Y A <kpuctjanpobam@mail.com> - 2021-01-12 15:25 -0800
                Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-13 09:14 +0000
                  Re: C o m p e t i t i o n . Y A <kpuctjanpobam@mail.com> - 2021-01-13 02:31 -0800
                    Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-13 20:01 +0000
                      Re: C o m p e t i t i o n . ند ارائه نماييدبا تشکر ند ارائه نمايي تش <kpuctjanpobam@mail.com> - 2021-01-14 08:29 -0800
                      Re: C o m p e t i t i o n . ند ارائه نماييدبا تشکر ند ارائه نمايي تش <kpuctjanpobam@mail.com> - 2021-01-14 08:48 -0800
                        Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-14 19:16 +0000
                          Re: C o m p e t i t i o n . H e <he12457@hotmail.com> - 2021-01-14 11:28 -0800
                            Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-15 07:46 +0000
                              Re: C o m p e t i t i o n . Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2021-01-17 23:23 +1100
                                Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-22 06:36 +0000
                            Re: C o m p e t i t i o n . David Brown <david.brown@hesbynett.no> - 2021-01-15 11:13 +0100
                      Re: C o m p e t i t i o n . Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2021-01-15 02:01 +1100
                        Re: C o m p e t i t i o n . Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-15 00:23 +0000
                          Re: C o m p e t i t i o n . David Brown <david.brown@hesbynett.no> - 2021-01-15 13:56 +0100
                            Re: C o m p e t i t i o n . H e <he12457@hotmail.com> - 2021-01-17 03:23 -0800
                              Re: C o m p e t i t i o n . Richard Heathfield <rjh@cpax.org.uk> - 2021-01-17 18:43 +0000

Page 2 of 2 — ← Prev page 1 [2]


#11787

FromDavid Brown <david.brown@hesbynett.no>
Date2021-01-15 13:56 +0100
Message-ID<rts3dr$4pm$1@dont-email.me>
In reply to#11784
On 15/01/2021 01:23, Ben Bacarisse wrote:
> Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> writes:
> 
>> Groovy hepcat Richard Heathfield was jivin' in comp.programming on Thu,
>> 14 Jan 2021 07:01 am. It's a cool scene! Dig it.
>>
>>> On 13/01/2021 10:31, Y A wrote:
>>>> Richard Heathfield kirjutas kolmapäev, 13. jaanuar 2021 kl 11:14:09
>>>> UTC+2:
>>>>> On 12/01/2021 23:25, Y A wrote:
>>>>>> Richard Heathfield kirjutas teisipäev, 12. jaanuar 2021 kl 18:17:01
>>>>>> UTC+2:
>>>>>>> On 12/01/2021 13:17, I I wrote:
>>>>>>>
>>>>>>> <snip>
>>>>>>>> I am so sorry, that You have not attended school . . . . . .
>>>>>>> Irony is always amusing, but the more so when unintentional.
>>>>>>
>>>>>> Hmmmmmmmmmmmmmmmmmmmm...........................
>>>>>> Cross sum isn't logically: sum of all digits?
>>>>>> abcde cs=a+b+c+d+e
>>>>> I'd never heard the term before the OP used it at the beginning of
>>>>> this thread, so I looked it up.
>>>>>
>>>>> The only meaning I could find for it online was "sum of all digits"
>>>>> (i.e. the digital root), so I calculated the sum of all digits.
>>>>>
>>>>> Presumably the OP (who has a different result) means something
>>>>> different by it, but he appears unwilling to share that meaning with
>>>>> us.
>>>>
>>>> OP=me
>>>
>>> Then you ought to know what you mean by "cross sum", so you ought to
>>> be in a position to share that information.
>>>
>>> If you mean "digital root", I've already given the correct answer,
>>> which you say is different to your answer, which means you're wrong.
>>
>>   Just to add my two cents to this discussion, for what it's worth
>> (somewhere between one and three cents, presumably), I wrote, compiled
>> and ran the following program. It bears out Richard's results.
> 
> Indeed (I would expect nothing else).  But the result is dependent on
> the base so there is some ambiguity in the question.
> 
> Here is a Haskell program (well, some Haskell functions) that can give
> the answer for various bases:
> 
>   digits b n = if n == 0 then [] else r : digits b q
>     where (q, r) = divMod n b
>    
>   dSum b n = sum $ digits b n
>    
>   crossSum b n = head $ dropWhile (>= b) $ iterate (dSum b) n
> 
> *Main> let n = 58349863148967341986793418678943167894317568943579812347643263461438776834177468314765864533703574653715456716465804656089576907569568456680257542768434686845796847604780607596864802468874265807426587026578406466539046579467684906749046758049663588463065836688638658768635806365889683658746862486247487652774625076485806648907696785970467957869053868763688046236880752825686569877668097860897676807746897456368844688745768468242622686282862869874986865749685796854096857706759759674569074359357697539375903576096780074367589368590356896686539
> *Main> dSum 10 n
> 2977
> *Main> crossSum 10 n
> 7
> *Main> crossSum 2 n
> 1
> *Main> crossSum 5 n
> 3
> 

And a Python implementation:

>>> def cs(ys) :
...     return sum([int(x) for x in str(ys)])
>>> cs(xs)
2977
>>> cs(cs(xs))
25
>>> cs(cs(cs(xs)))
7

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


#11803

FromH e <he12457@hotmail.com>
Date2021-01-17 03:23 -0800
Message-ID<1ebf4e08-473d-409a-a9e5-f8c1996556f8n@googlegroups.com>
In reply to#11787
David Brown kirjutas reede, 15. jaanuar 2021 kl 14:56:31 UTC+2:
> On 15/01/2021 01:23, Ben Bacarisse wrote: 
> > Peter 'Shaggy' Haywood <phay...@alphalink.com.au> writes: 
> > 
> >> Groovy hepcat Richard Heathfield was jivin' in comp.programming on Thu, 
> >> 14 Jan 2021 07:01 am. It's a cool scene! Dig it. 
> >> 
> >>> On 13/01/2021 10:31, Y A wrote: 
> >>>> Richard Heathfield kirjutas kolmapäev, 13. jaanuar 2021 kl 11:14:09 
> >>>> UTC+2: 
> >>>>> On 12/01/2021 23:25, Y A wrote: 
> >>>>>> Richard Heathfield kirjutas teisipäev, 12. jaanuar 2021 kl 18:17:01 
> >>>>>> UTC+2: 
> >>>>>>> On 12/01/2021 13:17, I I wrote: 
> >>>>>>> 
> >>>>>>> <snip> 
> >>>>>>>> I am so sorry, that You have not attended school . . . . . . 
> >>>>>>> Irony is always amusing, but the more so when unintentional. 
> >>>>>> 
> >>>>>> Hmmmmmmmmmmmmmmmmmmmm........................... 
> >>>>>> Cross sum isn't logically: sum of all digits? 
> >>>>>> abcde cs=a+b+c+d+e 
> >>>>> I'd never heard the term before the OP used it at the beginning of 
> >>>>> this thread, so I looked it up. 
> >>>>> 
> >>>>> The only meaning I could find for it online was "sum of all digits" 
> >>>>> (i.e. the digital root), so I calculated the sum of all digits. 
> >>>>> 
> >>>>> Presumably the OP (who has a different result) means something 
> >>>>> different by it, but he appears unwilling to share that meaning with 
> >>>>> us. 
> >>>> 
> >>>> OP=me 
> >>> 
> >>> Then you ought to know what you mean by "cross sum", so you ought to 
> >>> be in a position to share that information. 
> >>> 
> >>> If you mean "digital root", I've already given the correct answer, 
> >>> which you say is different to your answer, which means you're wrong. 
> >> 
> >> Just to add my two cents to this discussion, for what it's worth 
> >> (somewhere between one and three cents, presumably), I wrote, compiled 
> >> and ran the following program. It bears out Richard's results. 
> > 
> > Indeed (I would expect nothing else). But the result is dependent on 
> > the base so there is some ambiguity in the question. 
> > 
> > Here is a Haskell program (well, some Haskell functions) that can give 
> > the answer for various bases: 
> > 
> > digits b n = if n == 0 then [] else r : digits b q 
> > where (q, r) = divMod n b 
> > 
> > dSum b n = sum $ digits b n 
> > 
> > crossSum b n = head $ dropWhile (>= b) $ iterate (dSum b) n 
> > 
> > *Main> let n = 58349863148967341986793418678943167894317568943579812347643263461438776834177468314765864533703574653715456716465804656089576907569568456680257542768434686845796847604780607596864802468874265807426587026578406466539046579467684906749046758049663588463065836688638658768635806365889683658746862486247487652774625076485806648907696785970467957869053868763688046236880752825686569877668097860897676807746897456368844688745768468242622686282862869874986865749685796854096857706759759674569074359357697539375903576096780074367589368590356896686539 
> > *Main> dSum 10 n 
> > 2977 
> > *Main> crossSum 10 n 
> > 7 
> > *Main> crossSum 2 n 
> > 1 
> > *Main> crossSum 5 n 
> > 3 
> >
> And a Python implementation: 
> 
> >>> def cs(ys) : 
> ... return sum([int(x) for x in str(ys)]) 
> >>> cs(xs) 
> 2977 
> >>> cs(cs(xs)) 
> 25 
> >>> cs(cs(cs(xs))) 
> 7

Comp. is over. Nothing to give You anymore.




He

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


#11810

FromRichard Heathfield <rjh@cpax.org.uk>
Date2021-01-17 18:43 +0000
Message-ID<ru20he$i09$1@dont-email.me>
In reply to#11803
On 17/01/2021 11:23, H e wrote:

<snip>

> Comp. is over. Nothing to give You anymore.

The competition was already dead when you failed to define what the 
problem was, and it was buried when you failed to acknowledge the 
correct answer even after it was posted independently by three different 
people.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.programming


csiph-web