I am getting a file from a system and in one column there is a number. This number is a sum of predetermined 15 numbers.(adsbygoogle = window.adsbygoogle || []).push({});

The 15 predetermined numbers (bits) are 1 2 4 8 16 32 64 128 256 512 1024 ...,

Each predetermined number can only be used once in the total number.

So if the number is given is 530, I know 512, 16, 2 were used.

Is there a formula to calculate the values used to make the number?

Thanks,

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Looking for a method to calculate what number are used to make a number

**Physics Forums | Science Articles, Homework Help, Discussion**