laziness, impatience, and hubris | |
PerlMonks |
Re^3: Triangle Numbersby particle (Vicar) |
on Apr 24, 2002 at 19:48 UTC ( [id://161750]=note: print w/replies, xml ) | Need Help?? |
This algorithm generates a sum of triangle numbers, but not necessarily a sum of _three_ triangle numbersEGAD! you're right. i've fixed it to generate a list of three or less (i think.) if you want precisely three, i'll have to do a little more thinking. Update: unless of course zero is valid. i can't see how it's not, because 1 must be 1, 0, 0. so i'll update my code (once more) to reflect that.
~Particle ;Þ
In Section
Cool Uses for Perl
|
|