Tips on projecteuler code optimization I am working on projecteuler # 14, http://projecteuler.net/problem=14 and my code takes too long to run. Any tips, or hints for a beginner?

Code:

////////////////////////
/// ProjectEuler # 14/// 
////////////////////////

#include &lt;iostream&gt;
#include &lt;tuple&gt;           //New, shaky on tuple
using namespace std;

bool tester(int n)      //Even number tester//It works 100%
{
    bool result = false;
    if (n%2 == 0) result = true;
    return result;
}

int collatz_counter (int collatz_number)    //Collatz sequence counter//It works 100%
{
    int j = collatz_number;
    int total = 0;
    do 
    {
        if (tester(j))
        {
            j /=2;
            total ++;
        }
        else
        {
            j = 3*j +1;
            total ++;
        }
    }while (j!=1);                                  
    total +=1;          // To account for the original number itself
    return total;
}

pair &lt;int n, int m&gt; value_finder (int n)    
{
    int max = 0;
    int max_number = 0;
    for (int i = n; i&gt;1; i--)
    {
        if(collatz_counter(i) &gt; max)
        {
            max_number = i;
            max = collatz_counter(i);
        }
    }
    max_number++;
    return{max, max_number};        
}                                   

int main (void)
{   
    int starter;
    int x;
    cout&lt;&lt;"Enter value :"&lt;&lt;endl;
    cin&gt;&gt;starter;
    cout&lt;&lt;endl;
    int Max = 0;
    int Max_Number = 0;
    for (x = starter; x&gt;= starter/2 ; x--)
    {
        int m, n;
        tie(m, n) = value_finder(x);                    
        if ( m&gt; Max)
        {
            Max_Number = n;
            Max = m;
        }
    }

    cout&lt;&lt;" The maximum numbers in the collatz sequence is "&lt;&lt;m&lt;&lt;endl;
    cout&lt;&lt;" The starting number of the collatz sequence is "&lt;&lt;n&lt;&lt;endl;
    system ("pause");
    return 0;
}
Hint

Taking the example from the Project Euler page, if you have computed the Collatz number for 5 in the past and you know it's 6, then when computing Collatz number for 10, you probably don't need to go through the whole chain. You can stop when you reach 5.

It might be interesting to cache the computed value to be able to reuse them.

(Disclaimer : I solved this problem a long time ago and cannot really remember how I did it)