Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Generator of integer partitionts of n

by blokhead (Monsignor)
on Aug 28, 2004 at 07:02 UTC ( #386572=note: print w/ replies, xml ) Need Help??


in reply to Re: Generator of integer partitionts of n
in thread Generator of integer partitionts of n

Changing $integer to 6 for example gives:

6 5 1 4 2 4 1 1 3 3 1 # oops 3 2 1 3 1 1 1 2 2 2 1 # oops 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1
You can check how many partitions of N exist for the first many values of N at this site. For N=10, for instance, there should be 77 and your script returns less than 50 (many of them even adding up to more than 10). Update: Other than an extra 1 on a few partitions here and there, it seems to get all of them though.

blokhead


Comment on Re^2: Generator of integer partitionts of n
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://386572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-07-04 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls