This function will find all the Keith numbers (also known as repfigit numbers) between the inputs min and max, inclusive.
The output matrix is a 2xN matrix, where N is the number of Keith numbers that were found between inputs. The first column is the number of digits in the found Keith number, and the second is the Keith number itself.
For larger numbers, make sure uint64() is used on arguments passed to the function. This ensures that the input is an unsigned integer 64, which will be able to handle larger numbers.
There is a maximum imposed by the storage capacity of unsigned integers 64. That is of 18446744073709551615. This can be found by running intmax('uint64').
getKeiths( uint64(10), uint64(10000) )
For more information on Keith numbers, see:
Sebastian (2020). Get Keith Numbers (https://www.mathworks.com/matlabcentral/fileexchange/39056-get-keith-numbers), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!