Bill Allombert on Sun, 14 Oct 2012 22:36:59 +0200


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

Re: iterators, sums and products


On Thu, Oct 11, 2012 at 10:14:17PM +0200, Loïc Grenié wrote:
>     Hi pari developers,
> 
>     what do you think of the following idea ? Does it look interesting
>   and feasible ?
> 
>     We have a forprime iterator. I've always wished I could sum over
>   primes.
> 
>     My idea is to introduce a new pari type t_ITERATOR which
>   could wrap some iterators (forprime, forsubgroup, forell, etc). For each
>   iterator there would be an initializer. There would also be some
>   users of those iterators: foriter, sumiter, proditer and (why not)
>   vectoriter. Usage:

I miss two things:
sumprime()
and a function that return the sum of the element of a vector.

Cheers,
Bill.