[seqfan] Re: Keyword:cons sequences in Maple

M. F. Hasler seqfan at hasler.fr
Wed Apr 9 13:30:44 CEST 2014


The shortest direct implementation might be
seq( `if`(c=".",NULL,parse(c)), c=convert( evalf[N](x) ,string))

Maximilian


On Tue, Apr 8, 2014 at 10:26 PM, <israel at math.ubc.ca> wrote:
>
> Actually, you can use RealDigits in the MmaTranslator[Mma] package:
>
>> MmaTranslator[Mma][RealDigits](evalf[100](sqrt(2)));
>
>
> [[1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8, 8, 0, 1, 6, 8, 8, 7, 2, 4, 2, 0, 9, 6, 9, 8, 0, 7, 8, 5, 6, 9, 6, 7, 1, 8, 7, 5, 3, 7, 6, 9, 4, 8, 0, 7, 3, 1, 7, 6, 6, 7, 9, 7, 3, 7, 9, 9, 0, 7, 3, 2, 4, 7, 8, 4, 6, 2, 1, 0, 7, 0, 3, 8, 8, 5, 0, 3, 8, 7, 5, 3, 4, 3, 2, 7, 6, 4, 1, 5, 7, 3, 0, 0, 0, 0], 1]
>
> (Hmm: I don't know why it puts in those extra four 0's).
>
> Or you can do this:
>>
>> ListTools:-Reverse(convert(round(10^99*sqrt(2)),base,10));
>
>
> [1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8, 8, 0, 1, 6, 8, 8, 7, 2, 4, 2, 0, 9, 6, 9, 8, 0, 7, 8, 5, 6, 9, 6, 7, 1, 8, 7, 5, 3, 7, 6, 9, 4, 8, 0, 7, 3, 1, 7, 6, 6, 7, 9, 7, 3, 7, 9, 9, 0, 7, 3, 2, 4, 7, 8, 4, 6, 2, 1, 0, 7, 0, 3, 8, 8, 5, 0, 3, 8, 7, 5, 3, 4, 3, 2, 7, 6, 4, 1, 5, 7, 3]
>
> Robert Israel
> University of British Columbia and D-Wave Systems
>
>
>
> On Apr 8 2014, Alonso Del Arte wrote:
>
>> Is there a recommended way in Maple to compute keyword:cons sequences? Like
>> for example 1/sqrt(2) ?
>>
>> (In Mathematica, that would be something like RealDigits[1/Sqrt[2] etc.)
>>
>> Al
>>
>>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list