Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://386572]
help
Chatterbox?
[huck]: erix some things also write to the raw console/tty/pty rather than stdout/stderr
[Discipulus]: see this useful site
[erix]: hm. ok. Either might be the case here. I guess I need to try out more
[choroba]: The redirections seem to happen right to left
[choroba]: but gurus say they in fact happen left to right, but we understand them wrongly
[marioroy]: bad gurus :)
[choroba]: also, &> redirects both at the same time
[marioroy]: erix are you using csh

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-03-23 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (284 votes). Check out past polls.