# What is the Ternary Sequence™

The sequence below, I call the $$\text{Ternary Sequence™}$$.

$$\begin{gather*} \text{T}(1) = 1\\ \text{T}(2) = 2\\ \text{T}(3) = 5\\ \text{T}(4) = 5\\ \text{T}(5) = 3\\ \text{T}(6) = 5\\ \text{T}(7) = 7\\ \text{T}(8) = 14\\ \text{T}(9) = \hspace{0.4em} \color{blue}{???}\\ \text{T}(10) = 3\\ \text{T}(11) = 4\\ \text{T}(12) = 5\\ \text{T}(13) = 25\\ \text{T}(14) = 14\\ \text{T}(15) = 15\\ \dots \end{gather*}$$

The sequence continues infinitely.

What is the pattern that these numbers follow?

What is $$\text{T}(9)$$?

• I like the fact that all your questions have TradeMark in them :P – Sagar Chand May 21 at 13:16
• @SagarChand It has been a trend for years before I joined. Some examples. – DenverCoder1 May 21 at 14:00

$$T(n)$$ = Ternary ( $$f(n)$$ )

where

$$f(n)$$ is minimum number $$x$$ formed with $$0,1,2$$ such that $$n | x$$.

By this logic T(9) is

Ternary($$12222$$) = $$161$$

• Hey, apologies if this question sounds naive, but how is T(3) = 5? T(3) = Ternary(12) , then what? Like how is Ternary(12222) = 161? – Sagar Chand May 24 at 7:05
• @SagarChand T(3) = 5 since the smallest decimal number consisting of only 0, 1, and 2 that is divisible by 3 is 12. If 12 were a number in base 3 (ternary), it would represent 5 in decimal ($1 \cdot 3^1 + 2 \cdot 3^0$). If 12222 were a ternary number, it would be 161 in decimal ($1 \cdot 3^4 + 2 \cdot 3^3 + 2 \cdot 3^2 + 2 \cdot 3^1 + 2 \cdot 3^0$). – DenverCoder1 Jun 17 at 10:52
• @eyl327 got it now thanks – Sagar Chand Jun 17 at 11:22