Current location - Training Enrollment Network - Mathematics courses - How many possibilities in mathematics can be summed up to 255?
How many possibilities in mathematics can be summed up to 255?
The split of a positive integer can be the sum of two or more positive integers.

If the sum of positive natural numbers is split (that is, it can contain 0) and can be repeated, then there are infinite schemes.

If it can't be repeated, it will be relatively small (in fact, the scale is still very large).

In this way, there can be A 1+A2, A 1+A2+A3, A 1+A2+...+An, where the maximum n is 23, because the sum of 0 to 23 is 276, which is already greater than 255.

The number of statistical schemes can be enumerated by programming. However, the efficiency is too low, and it takes a long time, maybe several hours.

Dynamic programming algorithm can get the total number quickly, but the disadvantage is that it can't list the specific splitting schemes.

Through the dynamic programming algorithm, the first scheme of splitting 255 into positive integers can be obtained. 11166959338. This includes the 255-bit splitting scheme, so it should be1166959337.

Adding a 0 to the above scheme is a new scheme containing 0.

So, what should be the total number of schemes? 1 1 166959337*2 =? 223339 18674. About 23.3 billion.

Attachment: calculation results and fortran code