Equation for Math problem

Mirc

New member
Joined
Nov 14, 2014
Messages
1
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:
example.jpg

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.
 
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:
View attachment 4635

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.

You cannot spell sheet?!!

Have you tackled arithmetic progression in your class? You have to use that logic.
 
As Subhotosh Kahn points out, the number of sheets in each stack is an 'arithmetic progression' -there are a sheets in the first stack, a+ b in the second, a+ 2b in the third, and, generally, a+ (n-1)b sheets in the nth stack. Further one can show that average of all the numbers in an arithmetic sequence is the average of the first and last numbers. Here, if there are n stacks, so that the first stack has a sheets of paper and the last stack a+ (n-1)b, then there average number of sheets in each stack is \(\displaystyle \frac{a+ (a+(n-1)b)}{2}= \frac{2a+ (n-1)b}{2}= a+ (n-1)\frac{b}{2}\). The reason for wanting to know the average number is that we can now say that the total number of sheets in n stacks is \(\displaystyle n(a+ (n-1)\frac{b}{2}\).

So, if you want to determine where the "x"th sheet is, first determine which stack it is in- determine n such that \(\displaystyle n(a+ (n-1)\frac{b}{2})< x< (a+ (n+1)\frac{b}{2}\). The number of sheets you need to remove to get to it is \(\displaystyle x- n(a+ (n-1)\frac{b}{2})- 1\).
 
Top