It is practically impossible to teach good programming style to students that have had prior exposure to Basic; as potential programmers they are mentally mutilated beyond hope of regeneration.
@Nathan, i was thinking the same thing. I would start with the list of all Fibonacci numbers less than x (your number to convert). say F(n) is the largest of these. Now add smaller numbers to F(n) starting with F(n-1). If your total ever goes above x, then remove the last number you added and decrement n. stop when your sum equals x. The numbers you've added are the factors.
Reply To This Comment
About the site:
Peter Krumins' blog about programming, hacking, software reuse, software ideas, computer security, browserling, google and technology.
@Nathan, i was thinking the same thing. I would start with the list of all Fibonacci numbers less than x (your number to convert). say F(n) is the largest of these. Now add smaller numbers to F(n) starting with F(n-1). If your total ever goes above x, then remove the last number you added and decrement n. stop when your sum equals x. The numbers you've added are the factors.
Reply To This Comment