# Challenge: Primitive Calculator

Solve the Primitive Calculator Problem.

## We'll cover the following

## Problem

**Primitive Calculator Problem**

Find the minimum number of operations needed to get a positive integer $n$ from $1$ using only three operations: add $1$, multiply by $2$, and multiply by $3$.

**Input:** An integer $n$.

**Output:** The minimum number of operations “$+1$,” “$×2$,” and “$×3$” needed to get $n$ from 1.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.