[racket] partitions

From: Jos Koot (jos.koot at gmail.com)
Date: Tue May 6 14:26:23 EDT 2014

Hi
 
Library *math/number-theory* provides procedure *partitions*,
which fastly tells you how many partitions a given nonnegative integer has
(based on http://en.wikipedia.org/wiki/Partition_(number_theory))

I have not found any procedure that generates the partitions themselves,
nor in PLT Racket nor in Planet.

Therefore I made my own code for procedures that
produce (lazy) streams and sequences of partitions
(make-partition-stream n) and (in-partitions n).

If you are interested, let me know and I'll send you the code.
It is too long to include it in this mail
(77 lines of docs, 31 lines of code and 160 lines of tests)

I would be happy with some feedback on my code.
Or even happier with a pointer to already existing code.
 
Best whishes, Jos


Posted on the users mailing list.