Showing the the language represented by a set is regular Is the language $L = \{ w \mid w $ is $ 3^n - 1 $ in some given representation $, n &gt; 0 \}$ regular? I know that it is regular. If each element in $L$ is represented as decimal numbers, $L = \{ 2, 8, 26, 80, 242, \ldots \}$. If in binary, $L = \{ 10, 1000, 11010, 1010000, 11110010, \ldots \}$. However, if in ternary, $L = \{ 2, 22, 222, 2222, 22222, \ldots \}$. From there, it is clear that a DFA can be designed to show that $L$ is regular. But what if it wasn't ternary that it became clear, but instead base 59 or base 1009?

My question is that for other sets, does there exist a clear method to determine if the language based on that set is regular or not? Or does it just depend on the cleverness of the solver?
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.