numbpart(n, {a = k})

"Ruud H.G. van Tol" <[email protected]> Fri, 17 Apr 2026 08:55:23 +0200
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
For https://oeis.org/A046682, I created this code:

first(nn) = {
   my( v = Vec( 1 / prod( k=1, nn, 1+(-x)^k, 1+x*O(x^nn) ) ) );
   vector( nn, i, ( numbpart(i-1) + v[i] ) / 2 );
}

This takes about a minute to return 10k values.

Is there a faster way to initialize v?

Would a variant numbpart(n, {a = k}) be interesting, like Maple has?
With the optional a-parameter like with partitions(k, {a = k}, {n = k}).

-- Greetings, Ruud