List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Re: Goodstein sequence
| [MUG] Re: Goodstein sequence |
|
Author: Maple User Group
Posted: Fri, 6 Dec 2002 18:02:21 -0500 (
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 4 Dec 2002 18:38:32 -0500 (EST)
From: Carl Devore "devore"
To: "maple-list"
Subject: Goodstein sequence
On Tue, 3 Dec 2002, Joe wrote:
> Are there any shortcut (e.g. like gcd,lcm or convert etc.)in Maple that help
> us to work out
> e.g. (I think this is what we call Goodstein sequence,but not sure)
> you got a number 275 and a base say 2 to convert to this form
> 2^8+2^4+2+1 or 2^(2^(2+1))+2^(2^(2))+2+1
Base conversion just requires integer quotients and remainders (iquo or
irem). No gcd's required. Or you can just use convert(275, base, 2).
Then apply that recursively to the expoments and cpnvert it to an
unevaluated exponential form for printing:
Goodstein:= proc(n,b)
local i,x;
x:= convert(n,base,b);
if n<b then n else add(x[i]*``(b)^Goodstein(i-1,b), i= 1..nops(x)) fi
end proc;
Goodstein(275,2);
Goodstein(275,3);
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 5 Dec 2002 07:57:48 +0530 (IST)
From: A Prashanth pg ee "aprash"
To: "maple-list"
Subject: Goodstein sequence
i guess you're trying to convert between bases. you should employ the
'convert' command (built into maple 7) to perform the transformation.
there exist two valid syntaxes for the command that allow you to transform
numbers of base 10 to numbers of any base or a list of numbers in one base
to a second base. look up help on 'convert, base' and the examples there
to learn how to run this command. hope that helps.
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 04 Dec 2002 22:07:40 -0800
From: "Maple"
Subject: Goodstein sequence
To: "maple-list"
Joe,
I don't know about "Goodstein sequences", but Maple's "convert" routine
converts between arbitrary bases. For some strange reason it returns the
results in reverse order of what I would expect (LSB on the left), so you
have to be careful of that.
> convert(275,base,3);
[2, 1, 0, 1, 0, 1]
> evalf(2*3^0 + 3^1 + 3^3 + 3^5);
275.
> convert([2,1,0,1,0,1],base,3,10);
[5, 7, 2]
>
-- Ron
|
[View Complete Thread]
Previous by date: [MUG] From output to input, Ascenzi
Next by date: [MUG] Re: Import RTF files into maple., Dr Francis J Wright
Previous thread: [MUG] system of differential equations :(, Eugene Makarov
Next thread: [MUG] Import RTF files into maple., Aldrovando Azeredo Araujo
|