• Create Account

### #Actuallomateron

Posted 16 October 2012 - 08:43 AM

I have this relation of numbers
0 - 1 ---> 0
1 - 2 ---> 1
0 - 2 ---> 2
2 - 3 ---> 3
1 - 3 ---> 4
0 - 3 ---> 5
3 - 4 ---> 6
2 - 4 ---> 7
1 - 4 ---> 8
0 - 4 ---> 9
4 - 5 ---> 10
3 - 5 ---> 11
2 - 5 ---> 12
1 - 5 ---> 13
0 - 5 ---> 14
...
...
...

Finally
a - b ---> x
so i want an equation were i put the values 'a' and 'b' and it gets me x, I know how to solve this using loops but i am dealing with x numbers of 500,000 so my loop will have to do 500,000 loops and you know that's not good.
I can't find the recurrence relation too.

### #2lomateron

Posted 16 October 2012 - 08:40 AM

I have this relation of numbers
0 - 1 ---> 0
1 - 2 ---> 1
0 - 2 ---> 2
2 - 3 ---> 3
1 - 3 ---> 4
0 - 3 ---> 5
3 - 4 ---> 6
2 - 4 ---> 7
1 - 4 ---> 8
0 - 4 ---> 9
4 - 5 ---> 10
3 - 5 ---> 11
2 - 5 ---> 12
1 - 5 ---> 13
0 - 5 ---> 14

Finally
a - b ---> x
so i want an equation were i put the values 'a' and 'b' and it gets me x, I know how to solve this using loops but i am dealing with x numbers of 500,000 so my loop will have to do 500,000 loops and you know that's not good.
I can't find the recurrence relation too.

### #1lomateron

Posted 16 October 2012 - 08:32 AM

I have this relation of numbers
0 ---> 0 - 1
1 ---> 1 - 2
2 ---> 0 - 2
3 ---> 2 - 3
4 ---> 1 - 3
5 ---> 0 - 3
6 ---> 3 - 4
7 ---> 2 - 4
8 ---> 1 - 4
9 ---> 0 - 4
10 ---> 4 - 5
11 ---> 3 - 5
12 ---> 2 - 5
13 ---> 1 - 5
14 ---> 0 - 5

Finally
x ---> a - b
so i want an equation or the 2 equations were i put the value x and it gets me the value of a and b, I know how to solve this using loops but i am dealing with x numbers of 500,000 so my loop will have to do 500,000 loops and you know that's not good.
I can't find the recurrence relation too.

PARTNERS