Showing the the language represented by a set is regular
See DFA for accepting all binary strings of form power of $n$ (not divisible by $n$) i.e. $n^k$ for given $n$. 

The proof for $L'=\{w \mid w \in \{0,1\}^*, w $ is $3^n$ in binary for some $ n &gt; 0 \}$ is not regular can be easily modified to prove that $L'=\{w \mid w \in \{0,1\}^*, w $ is $3^n - 1$ in binary for some $ n &gt; 0\}$ is not regular. 

However in ternary the same language is regular. It is similar to case of $2^n$ and $2^n-1$. So for some bases you might be able to prove these kind of languages regular but for others you may not.