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

 Greetings from P (Posted on 2013-01-24)
Derive a formula for the number of partitions of n into parts that are odd and bigger than 1; e.g. a(12)=5 cases: 3+3+3+3, 5+7, 7+5, 3+9, 9+3.

Verify your formula by evaluating a(14).

 No Solution Yet Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 what if... | Comment 2 of 5 |

What if the order didn't matter in the sums: for example, 5+7 and 7+5 counted as only one way of adding to 12?

DECLARE SUB decompose (x#, b#)
DEFDBL A-Z
CLEAR , , 25000
DIM SHARED ct
CLS
FOR n = 1 TO 45
ct = 0
decompose n, 3
PRINT n, ct
NEXT n

SUB decompose (x, b)
IF x < b THEN EXIT SUB
FOR addend = b TO x STEP 2
IF addend = x THEN
ct = ct + 1
ELSE
END IF
NEXT
END SUB

`1             02             03             14             05             16             17             18             19             210            211            212            313            314            415            516            517            618            819            820            1021            1222            1323            1524            1825            2026            2327            2728            3029            3430            4031            4432            5033            5834            6435            7336            8337            9238            10439            11840            13141            14742            16643            18444            20645            232`

 Posted by Charlie on 2013-01-24 15:04:11

 Search: Search body:
Forums (0)