Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Re: Triangle Numbersby YuckFoo (Abbot) |
on Apr 24, 2002 at 19:36 UTC ( [id://161745]=note: print w/replies, xml ) | Need Help?? |
Good ideas particle, glad to see'em. This algorithm
generates a sum of triangle numbers, but not necessarily
a sum of _three_ triangle numbers. According to this,
26=21+3+1+1. But whole numbers can all be written as a
sum of three tnums, 26=1+10+15. I think it would take
some ugly backtracking to get yours to conform. Or
else something clever. Update: Particle, that does it, real slick, not sure why I thought it would have to get ugly. I like it! YuckFoo
In Section
Cool Uses for Perl
|
|