JSFiddle - React, Tailwind, and code Playground

JavaScript

function findSolution(target) {
  function find(start, history, depth) {
    depth += '    '
    if (start == target)
      return depth + history;
    else if (start > target) {
    	console.log(depth + history + ' ← null here')
      return null;
    }
    else {
      console.log(depth + history)
      return find(start + 5, "(" + history + " + 5)", depth) ||
             find(start * 3, "(" + history + " * 3)", depth);
    }
  }
  return find(1, "1", '');
}

console.log(findSolution(13));