for n in 10..30 repeat output [n, factor(2^n-1)]

This gives the first n in factored form which I don't want. How can I obtain the first n in unfactored form?

Thanks,

Alasdair

------=_Part_31456_21307642.1201902676971-- From MAILER-DAEMON Fri Feb 01 16:52:22 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JL3o5-0004Fe-Sm for mharc-axiom-mail@gnu.org; Fri, 01 Feb 2008 16:52:21 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JL3o4-0004F5-JK for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:52:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JL3o0-0004Bk-8w for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:52:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JL3nz-0004BT-Uo for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:52:16 -0500 Received: from wa-out-1112.google.com ([209.85.146.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from

-A

------=_Part_31466_494119.1201902733913-- From MAILER-DAEMON Fri Feb 01 16:59:35 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JL3v5-0007lb-73 for mharc-axiom-mail@gnu.org; Fri, 01 Feb 2008 16:59:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JL3v3-0007lM-9D for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:59:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JL3v1-0007l4-Uj for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:59:33 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JL3v1-0007l1-Ny for axiom-mail@nongnu.org; Fri, 01 Feb 2008 16:59:31 -0500 Received: from grace.univie.ac.at ([131.130.3.115]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from

for n in 10..30 repeat output [n::String, factor(2^n-1)]

is probably the simplest.

-Alasdair

On Feb 2, 2008 11:29 PM, Bill Page <bill.page@newsynthesis.org> wrote:

On 02 Feb 2008 08:28:29 +0100, Martin Rubey wrote:Yes, but for me at least

> > I think this is a little prettier:

> >

> > (1) -> _<_< (x,y) == hconcat(x,y)$OutputForm

>

>

> Yes, very nice!

>

>

> > Here, once the concept of << is understood, the only obscure notation

> > is probably

> >

> > " = "::Symbol

> >

> > which is just a way to avoid printing the quotation marks " around the

> > string.

>

>

> Use message$OUTFORM instead.

>

" = "::Symbol

looks better. I think that Axiom outputs quotes " ... " for something

of type string is probably a mistake.

Regards,

Bill Page.

_______________________________________________

Axiom-mail mailing list

Axiom-mail@nongnu.org

http://lists.nongnu.org/mailman/listinfo/axiom-mail

------=_Part_740_14773062.1201957624888-- From MAILER-DAEMON Sat Feb 02 12:39:51 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JLMLH-00048g-3W for mharc-axiom-mail@gnu.org; Sat, 02 Feb 2008 12:39:51 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLMLF-00048b-DZ for axiom-mail@nongnu.org; Sat, 02 Feb 2008 12:39:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLMLE-00048P-Rc for axiom-mail@nongnu.org; Sat, 02 Feb 2008 12:39:48 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLMLE-00048M-MP for axiom-mail@nongnu.org; Sat, 02 Feb 2008 12:39:48 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from

for n in 10..30 repeat output [n, factor(2^n-1)]

it is axiom which is at fault, or at least the expression parsing of it. Since factor clearly is only applied to the second term in the list, it shouldn't be applied to the first. And I shouldn't have to coerce n to type String, Symbol etc to force nonfactoring.

-Alasdair

On Feb 3, 2008 4:39 AM, Bill Page <bill.page@newsynthesis.org> wrote:

On 2/2/08, Alasdair McAndrew <amca01@gmail.com> wrote:Although this apparently produces the effect that you wanted I think

> Actually,

>

> for n in 10..30 repeat output [n::String, factor(2^n-1)]

>

> is probably the simplest.

>

it is also a very poor notation to achieve this effect. To understand

why it is a bad choice you need to understand how Axiom assigns types

to various objects - this is very complicated and often quite

unexpected - even when it works. The problem is finding a good way to

write this that always works the way you expect.

Regards,

Bill Page.

------=_Part_2120_8837265.1201985350409-- From MAILER-DAEMON Sat Feb 02 16:31:13 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JLPxB-0000yu-Li for mharc-axiom-mail@gnu.org; Sat, 02 Feb 2008 16:31:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLPxA-0000xS-Oc for axiom-mail@nongnu.org; Sat, 02 Feb 2008 16:31:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLPx9-0000u2-C4 for axiom-mail@nongnu.org; Sat, 02 Feb 2008 16:31:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLPx9-0000tp-2X for axiom-mail@nongnu.org; Sat, 02 Feb 2008 16:31:11 -0500 Received: from mx-7.zoominternet.net ([24.154.1.26]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from

for n in 10..30 repeat output [n,[factor(2^n-1)]]

I take your point about typing; just that there are occasions when Axiom's typing rules forces the idiot user (i.e., me!) to put more effort into obtaining a result than he wanted!

-Alasdair

On Feb 3, 2008 9:39 AM, root <daly@axiom-developer.org> wrote:

Axiom's type system, like any type system, forces you to understand

>it is axiom which is at fault, or at least the expression parsing of it.

>Since factor clearly is only applied to the second term in the list, it

>shouldn't be applied to the first. And I shouldn't have to coerce n to type

>String, Symbol etc to force nonfactoring.

what your expression means. In your original case you are asking to

create a list object. Lists have a single type based on their

contents. The full type of the list is List Factored Integer

so all of the elements are of the same type.

Axiom correctly resolved to the lowest common point in the type tower

and this is both the correct and expected behavior.

If you want a List Any immediately you could construct one as in:

m:List Any:=nil

for n in 10..30 repeat output concat(i,concat(j,m))

or, more concisely:

for n in 10..30 repeat output [n::Any, factor(2^n-1)]

Tim

------=_Part_2767_14253389.1202003882610-- From MAILER-DAEMON Sat Feb 02 21:08:40 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JLUHg-0006LN-2p for mharc-axiom-mail@gnu.org; Sat, 02 Feb 2008 21:08:40 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLUHe-0006Kq-RI for axiom-mail@nongnu.org; Sat, 02 Feb 2008 21:08:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLUHd-0006KD-A3 for axiom-mail@nongnu.org; Sat, 02 Feb 2008 21:08:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLUHd-0006KA-8L for axiom-mail@nongnu.org; Sat, 02 Feb 2008 21:08:37 -0500 Received: from mx-7.zoominternet.net ([24.154.1.26]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from

k(b+1)^(k-1)*x

where b is a constant. I wanted to multiply through by x(b+1) or similar. How to I tell Axiom that b is a constant, k is a positive integer, and x is the polynomial's variable? I tried setting the type to UP(x,POLY INT), but I just got Expression Integer instead. This didn't help, as I wanted to perform a monicDivide (w.r.t. x) later on.

Thanks,

Alasdair

------=_Part_25526_29597589.1202390431355-- From MAILER-DAEMON Thu Feb 07 10:43:50 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JN8uk-0007Zj-CZ for mharc-axiom-mail@gnu.org; Thu, 07 Feb 2008 10:43:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JN8ui-0007Ze-AL for axiom-mail@nongnu.org; Thu, 07 Feb 2008 10:43:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JN8uh-0007ZS-Fe for axiom-mail@nongnu.org; Thu, 07 Feb 2008 10:43:47 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JN8uh-0007ZP-Cc for axiom-mail@nongnu.org; Thu, 07 Feb 2008 10:43:47 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from