Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?
[Corion]: erix: I'm not sure if it really is MySQL - maybe MS SQL also has LIMIT 0
[erix]: it has TOP, IIRC
[Corion]: erix: Ah. I use where 1 = 0 for queries where I only am interested in the structure ;)
[erix]: 1=0 is as short as TOP :)
[erix]: "code of someone that died" -- kinda nice if your code stops working too

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-01-23 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.