Write a recursive function that, given two natural numbers @n@ and @b@, returns true if and only if @n@ has three or more equal consecutive digits when expressed in base @b@.
For example, the number 44344 does not have three equal consecutive digits in base 10. By contrast, 159 in ternary is 12220, so it does have three equal consecutive digits in base 3.
It holds @n@ and @b@ .
| C++ | |
| C | |
| Java | |
| Python | |
|
You only need to submit the required procedure; your main program will be ignored.