This code below seems to accurately return the number of "repeating
digits" (576) using Perl6 alone:

mbook: homedir$  perl6 -e 'say
(6658570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/470832).base-repeating()>>.chars;'
(1173 576)
mbook: homedir$

HTH, Bill.





On Wed, Feb 26, 2020 at 12:09 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:
>
> On 2020-02-26 11:34, Peter Scott wrote:
> >
> > On 2/26/2020 11:14 AM, ToddAndMargo via perl6-users wrote:
> >> I used gnome calculator to 20 digits:
> >>     665857/470832
> >>     1.41421356237468991063
> >> Sorry.  Not seeing any repeating patterns.
> >>
> >> Here is NAS doing it to 1 million digits (they have too
> >> much time on their hands):
> >> https://apod.nasa.gov/htmltest/gifcity/sqrt2.1mil
> >> No repeats.
> >
> > As well there shouldn't be in an irrational number.  sqrt(2) !=
> > 665857/470832
> >>
> >> So why does base-repeating tell me there is a repeating
> >> pattern when there is not?
> >>
> >> Ah ha, 99/70 does have a repeat:
> >> 1.4142857 142857 142857 1
> >>
> >> Maybe 665857/470832 I just do not go out enough digits to
> >> see a repeat.
> >
> > Correct.  As a really disgustingly quick and dirty way of proving that
> > the expansion has a repeating cycle of 576 digits:
> >
> > $ perl6 -e 'say
> > 6658570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/470832'
> > | perl -lne '/(\d{4,})\1/ and print length $1, ": $1"'
> > 576:
> > 135623746899106262955788901349101165596221157440445849050192000543718353892683589900431576443402317599483467563801950589594590002378767798280490705814388146939885139497740170591633533829476331260407109117477146837937948142861997485302613246338396710503958949264281102388962517415978523125021238998198932952730485608454820403031229822951711013694906038671967920617120331668195874536989839263261630475413735684915213919189859652699901451048356951099330546776769633329935093621504060896455635980562068848336561661059571142148367145818466034594080266421993407414959051211472457267
> >
>
> Hi Peter,
>
> Thank you!  The more I learn about Raku, the more
> fascinating I find it!
>
> :-)
>
> -T

Reply via email to