All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Odd partition (Posted on 2019-05-09)
There are 3 ways to write 4 as a sum of odd numbers (assuming order matters and numbers can be repeated in the sum): 3+1, 1+3, and 1+1+1+1.

How many ways are there to write 19 as a sum of odd numbers?

Hint: The above result has something to do with Fibonacci numbers

 No Solution Yet Submitted by Danish Ahmed Khan No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2
DefDbl A-Z
Dim crlf\$, ways, n, togo

Text1.Text = ""
crlf\$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents

For n = 2 To 25
ways = 0
togo = n
Text1.Text = Text1.Text & n & Str(ways) & crlf
Next

Text1.Text = Text1.Text & ct & " done"
End Sub

For amt = 1 To togo Step 2
togo = togo - amt
If togo = 0 Then
ways = ways + 1
Else
End If
togo = togo + amt
Next
End Sub

finds

2 1
3     2
4     3
5     5
6    8
7   13
8   21
9   34
10  55
11  89
12 144
13 233
14 377
15 610
16 987
17 1597
18 2584
19 4181
20 6765
21 10946
22 17711
23 28657
24 46368
25 75025

For 19, the sum is 4181. I do see the Fibonacci sequence here.

 Posted by Charlie on 2019-05-09 14:13:14

 Search: Search body:
Forums (0)