src/algorithms/math/collatz_conjecture.js
function calculateCollatzConjecture(number) {
  if (!(number in cache)) {
    if (number % 2 === 0) cache[number] = number >> 1;
    else cache[number] = number * 3 + 1;
  }

  return cache[number];
}
function calculateCollatzConjecture(number) {
  if (!(number in cache)) {
    if (number % 2 === 0) cache[number] = number >> 1;
    else cache[number] = number * 3 + 1;
  }

  return cache[number];
}
function calculateCollatzConjecture ( number ) { if ( ! ( number in cache ) ) { if ( number % 2 === 0 ) cache [ number ] = number >> 1 ; else cache [ number ] = number * 3 + 1 ; } return cache [ number ] ; }
Collatz Conjecture algorithm

@param Number
@return Number
Collatz Conjecture algorithm