Hi mates.
I am dealing with a math problem but cant seem to solve it. This is my assignment:
I have infinite numbers of numbered paper s-h-i-t-s (1,2,3, ..). This s-h-i-t-s are stacked into stacks using 2 variables a and b.
If a = 5 and b = 3 the stacks look like:
So the first list has "a" items (5) and each next has "b" more (3) as previous.
Now i Have to figure out an equation that would tell me how many s-h-i-t-s of paper I need to remove to get to the specific one. For example if I want to get to the s-h-i-t numbered with 19, I will need to remove 5 shits of paper to get to it. And this is the solution I am looking for, when I would enter a numbered of a specific s-h-i-t I just need to know how many I need to move(in the stack that it is in) to get to it.
Since I will make a program with it that will deal with long numbers (up to 16 digits), the best solution would be to find some "non loop" equation. For example if I will set a = 34354 and b = 56774 and I want to know how many shits of paper to remove to get to s-h-i-t-s numbered with 533663634611112.
Thanks for all help about this issue.
I am dealing with a math problem but cant seem to solve it. This is my assignment:
I have infinite numbers of numbered paper s-h-i-t-s (1,2,3, ..). This s-h-i-t-s are stacked into stacks using 2 variables a and b.
If a = 5 and b = 3 the stacks look like:
So the first list has "a" items (5) and each next has "b" more (3) as previous.
Now i Have to figure out an equation that would tell me how many s-h-i-t-s of paper I need to remove to get to the specific one. For example if I want to get to the s-h-i-t numbered with 19, I will need to remove 5 shits of paper to get to it. And this is the solution I am looking for, when I would enter a numbered of a specific s-h-i-t I just need to know how many I need to move(in the stack that it is in) to get to it.
Since I will make a program with it that will deal with long numbers (up to 16 digits), the best solution would be to find some "non loop" equation. For example if I will set a = 34354 and b = 56774 and I want to know how many shits of paper to remove to get to s-h-i-t-s numbered with 533663634611112.
Thanks for all help about this issue.