Bill Allombert on Wed, 03 Apr 2013 20:16:53 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI 2.6 syntax 2: [f(x)|x<-a,b(x)]


On Thu, Mar 28, 2013 at 05:56:12PM +0100, Bill Allombert wrote:
> I am proposing an alternative: use semi-colon as separator,
> see branch bill-multi_compr2:
> 
> ? [a^2+b^2|a<-[1..10];b<-[1..10],gcd(a,b)==1]
> %1 = [2,5,10,17,26,37,50,65,82,101,5,13,29,53,85,10,13,25,34,58,73,109,17,25,41,65,97,26,29,34,41,61,74,89,106,37,61,85,50,53,58,65,74,85,113,130,149,65,73,89,113,145,82,85,97,106,130,145,181,101,109,149,181]
> 
> ? [a^2+b^2|a<-[1..10],isprime(a);b<-[1..10],a!=b && isprime(b)]
> %3 = [13,29,53,13,34,58,29,34,74,53,58,74]

Karim preferred this version, so I commited it.
Please test!

Cheers,
Bill.