Company: IBM
Difficulty: medium
Find out sum of all odd Bell numbers between a particular range Odd numbers are whole numbers that are not divisible by number 2. And a Bell number is the number of ways that n distinguishable objects (such as differently colored balls) can be grouped into sets (such as buckets) if no set can be empty. For example, if there are three balls, colored red (R), green (G), and blue (B), they can be grouped in five different ways: (RGB), (RG)(B), (RB)(G), (BG)(R), and (R)(G)(B), so that the third Bell number is 5. The sequence of Bell numbers, 1, 2, 5, 15, 52, 203, 877, 4140, 21147,..., can be built up in the form of a triangle, as follows. The first row has just the number one. Each successive row begins with the last number of the previous row and continues by adding the number just written down to the number immediately above and to the right of it. 1 1 2 2 3 5 5 7 10 15 15 20 27 37 52 52 67 87 114 151 203 203 255 322 409 523 674 877 877 ... The Bell numbers appear down the left-hand side