B A given integer can be written in how many different ways?

  • B
  • Thread starter Thread starter kent davidge
  • Start date Start date
  • Tags Tags
    Integer
kent davidge
Messages
931
Reaction score
56
I had learned how to find this out in the past, but forgot now. Precisely, I'm trying to find in how many different ways I can express the number 24 as a sum of two integers ranging from 1 to 24. For example, 24 = 24 = 23 + 1 = 12 + 12...
 
Physics news on Phys.org
Do you count (23,1) and (1,23) as two or one?
 
  • Like
Likes kent davidge
Just make a little table. First column is 0,1,...;second column is 24,23,...
Then it should be clear when you get to 13...?
 
  • Like
Likes kent davidge
fresh_42 said:
Do you count (23,1) and (1,23) as two or one?
One. This somehow hints me at the usage of permutations.
 
With two objects its not a big deal...its either forward or backward
 
  • Like
Likes kent davidge
Going through permutations, perhaps it is better to start off with a smaller number to get a feeling of what I'm working with. Let me take number 4. I can form ##4!/(2!2!)## pairs composed of two different numbers from the set ##\{1,2,3,4\}##, right? This is equal to 6. However this is still bigger than the actual number, which I did by hand and is 4, i.e., 4 = 4 = 3 + 1 = 2 + 2 + 2 = 2 + 1 + 1. That must be because in the calculation I did, I included 3 + 3 and 4 + 4. So I would have to figure out a way of removing those combinations that sum up to a number greater than the number I'm considering.

So I'm not sure this method is useful.
 
Try the table described in post #3. This is not difficult.
 
  • Like
Likes kent davidge
hutchphd said:
Try the table described in post #3. This is not difficult.
aha, indeed it gives me the number of ways "right on the nose" as you english speakers say :)
 
kent davidge said:
aha, indeed it gives me the number of ways "right on the nose" as you english speakers say :)
The most difficult thing is the floor function: ##\lfloor \frac{n}{2} \rfloor##.
 
  • #10
fresh_42 said:
The most difficult thing is the floor function
I am an old guy and I never heard that nomenclature (floor) until maybe a year ago. Did it migrate from a particular computer language?? It is less ambiguous.
 
  • #11
I think floor and ceil are older than programming, but I have no idea where it first appeared. Probably quite a while ago, because they simply generalize the (Gauß?) bracket ##[r]## for the nearest integer.
 
  • Like
Likes hutchphd
Back
Top