Project Euler - Smallest multiple
You arrive at the answer by counting 20 at a time.  That's 11639628 iterations of the main loop — and many recursive calls to calculate().

A more efficient and satisfying approach would be to use the Euclidean Algorithm to compute LCMs.

Note that an int is not guaranteed to be large enough to hold the result.  I suggest using long everywhere.

#include &lt;iostream&gt;

long gcd(long a, long b) {
    while (b) {
        int prevB = b;
        b = a % b;
        a = prevB;
    }
    return a;
}

long lcm(long a, long b) {
    return a * (b / gcd(a, b));
}

int main() {
    long result = 20;
    for (long number = result - 1; number &gt; 1; --number) {
        result = lcm(result, number);
    }
    std::cout &lt;&lt; result &lt;&lt; '\n';
}