Re: numdiv records

Bill Allombert <[email protected]> Mon, 25 May 2026 19:36:02 +0200
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <ahSIgh4v6kz3E8CJ@seventeen>
On Mon, May 25, 2026 at 06:38:32PM +0200, Ruud H.G. van Tol wrote:
> oeis:A00218 lists numdiv-records:
> first(nn)= {
>   my(n=0, r=0, s=1, t);
>   vector
>   ( nn
>   , i
>   , while( (t=numdiv(n+=s)) <= r, );
>     2==s || n<10 || s=2;
>     r=t
>   );
> }
> 
> How to do this more efficiently?

Use forfactored ?

Cheers,
Bill.