n
b
k
k
k
n
k
n
Let
n
k=\lfloorlogb{n}\rfloor+1
n
b
di=
n\bmodbi-n\bmodbi | |
bi |
n
We define the sequence
S(i)
0\leqi<k
S(i)=dk
i\geqk
S(i)=
k | |
\sum | |
j=0 |
S(i-k+j)
If there exists an
i
S(i)=n
n
For example, 88 is a Keith number in base 6, as
S(0)=d3=d2=
88\bmod62-88\bmod62 | |
62 |
=
88\bmod216-88\bmod36 | |
36 |
=
88-16 | |
36 |
=
72 | |
36 |
=2
S(1)=d3=d1=
88\bmod61-88\bmod61 | |
61 |
=
88\bmod36-88\bmod6 | |
6 |
=
16-4 | |
6 |
=
12 | |
6 |
=2
S(2)=d3=d0=
88\bmod60-88\bmod60 | |
60 |
=
88\bmod6-88\bmod1 | |
1 |
=
4-0 | |
1 |
=
4 | |
1 |
=4
S(i)=\{2,2,4,8,14,26,48,88,162,\ldots\}
S(7)=88
Whether or not there are infinitely many Keith numbers in a particular base
b
| ||||
2{10} ≈ |
2.99
14, 19, 28, 47, 61, 75, 197, 742, 1104, 1537, 2208, 2580, 3684, 4788, 7385, 7647, 7909, 31331, 34285, 34348, 55604, 62662, 86935, 93993, 120284, 129106, 147640, 156146, 174680, 183186, 298320, 355419, 694280, 925993, 1084051, 7913837, 11436171, 33445755, 44121607, 129572008, 251133297, ...[4]
In base 2, there exists a method to construct all Keith numbers.
The Keith numbers in base 12, written in base 12, are
11, 15, 1Ɛ, 22, 2ᘔ, 31, 33, 44, 49, 55, 62, 66, 77, 88, 93, 99, ᘔᘔ, ƐƐ, 125, 215, 24ᘔ, 405, 42ᘔ, 654, 80ᘔ, 8ᘔ3, ᘔ59, 1022, 1662, 2044, 3066, 4088, 4ᘔ1ᘔ, 4ᘔƐ1, 50ᘔᘔ, 8538, Ɛ18Ɛ, 17256, 18671, 24ᘔ78, 4718Ɛ, 517Ɛᘔ, 157617, 1ᘔ265ᘔ, 5ᘔ4074, 5ᘔƐ140, 6Ɛ1449, 6Ɛ8515, ...where ᘔ represents 10 and Ɛ represents 11.
A Keith cluster is a related set of Keith numbers such that one is a multiple of another. For example, in base 10,
\{14,28\}
\{1104,2208\}
\{31331,62662,93993\}
The example below implements the sequence defined above in Python to determine if a number in a particular base is a Keith number:
sequence = [] y = x
while y > 0: sequence.append(y % b) y = y // b
digit_count = len(sequence) sequence.reverse
while sequence[len(sequence) - 1] < x: n = 0 for i in range(0, digit_count): n = n + sequence[len(sequence) - digit_count + i] sequence.append(n)
return sequence[len(sequence) - 1]