Get Keith Numbers
by Sebastian
15 Nov 2012
(Updated 16 Nov 2012)
Finds and returns all Keith numbers between min and max inputs
|
Watch this File
|
| File Information |
| Description |
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').
Example:
getKeiths( uint64(10), uint64(10000) )
ans =
2 14
2 19
2 28
2 47
2 61
2 75
3 197
3 742
4 1104
4 1537
4 2208
4 2580
4 3684
4 4788
4 7385
4 7647
4 7909
For more information on Keith numbers, see:
http://mathworld.wolfram.com/KeithNumber.html
http://en.wikipedia.org/wiki/Keith_number
https://www.youtube.com/watch?v=uuMwz47LV_w |
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.11 (R2010b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 16 Nov 2012 |
Fixed function's help |
|
Contact us