Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  How can I view a digit on the N-th position of 9^(9^9)
      in Haskell? (Michael Orlitzky)
   2. Re:  How can I view a digit on the N-th position of 9^(9^9)
      in Haskell? (Ut Primum)


----------------------------------------------------------------------

Message: 1
Date: Fri, 7 Jun 2019 10:52:50 -0400
From: Michael Orlitzky <mich...@orlitzky.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] How can I view a digit on the N-th
        position of 9^(9^9) in Haskell?
Message-ID: <074b7349-665a-bd0d-2fdd-054226060...@orlitzky.com>
Content-Type: text/plain; charset=utf-8

On 6/7/19 12:06 AM, Sergej KAREL wrote:
> Hello Francesco,
> Im total beginner. I read some books and online pages.
> I do not know, how to apply your rows if Im looking eg. digit on
> position *177486336 *of the number string
> Sorry for asking so straightforward
> Sergej

This is a math problem. Read the first few chapters of a book on number
theory -- you'll usually find something like this in the exercises.

For example, exercise 2.30 in the freely-available "Elementary Number
Theory: Primes, Congruences, and Secrets" by William Stein:

  https://wstein.org/ent/



------------------------------

Message: 2
Date: Fri, 7 Jun 2019 18:21:39 +0200
From: Ut Primum <utpri...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] How can I view a digit on the N-th
        position of 9^(9^9) in Haskell?
Message-ID:
        <canjdmkjpfj+owzc68jy3nbdsclmtun8atsofz3x4nnatwq7...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello Sergej,

if you need to know the  Nth digit of a number (i.e. 10987654321), assuming
that we say that the rightmost digit is the digit 1, (so in my example 1st
digit is 1), you can use:
> x=10987654321
> div (mod x (10^N)) (10^(N-1))

So, *if you don't need a fast program* and you want to compute the digit in
position 177486336 of 9^(9^9):
> x=9^(9^9)
> div (mod x (10^177486336)) (10^177486335)
(it takes about 1 minute to compute it)

or in general if you want to know the N-th digit :
> x=9^(9^9)
> div (mod x (10^N)) (10^(N-1))

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno ven 7 giu 2019 alle ore 16:53 Michael Orlitzky <
mich...@orlitzky.com> ha scritto:

> On 6/7/19 12:06 AM, Sergej KAREL wrote:
> > Hello Francesco,
> > Im total beginner. I read some books and online pages.
> > I do not know, how to apply your rows if Im looking eg. digit on
> > position *177486336 *of the number string
> > Sorry for asking so straightforward
> > Sergej
>
> This is a math problem. Read the first few chapters of a book on number
> theory -- you'll usually find something like this in the exercises.
>
> For example, exercise 2.30 in the freely-available "Elementary Number
> Theory: Primes, Congruences, and Secrets" by William Stein:
>
>   https://wstein.org/ent/
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20190607/4f258a38/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 132, Issue 2
*****************************************

Reply via email to