Karim Belabas on Thu, 20 Sep 2012 11:51:48 +0200

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

Re: forprime

* Charles Greathouse [2012-09-18 21:23]:
> > As for me not looping over all composits, but looping over integers
> > with a given number of divisors will be of great interest.
> But it's hard to think of examples off the top of my head. Very often
> it just comes up in the middle of a problem where I find the need and
> I just code something.

To my surprise, I'm using it quite a lot today, when using GP as a
simple calculator to quickly tune isprimepower(). It's actually
quite convenient :-)

forfactored() is also interesting [ since one can quickly emulate
forsquarefree(), fordisc(), etc. from this one ].

Do you already have code for it ?

Thanks for suggesting this,

Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]