Finding Belgian numbers
Eugene McDonnell
eemcd at mac.com
Sat Jun 18 02:23:47 CEST 2005
If n is a positive integer (176)
and s is the sum-scan of its digits (1 8 14)
and m is the sum of its digits (14)
find j, the number of integral times m goes into n
j = floor(n/m) (12)
find k, the multiple of n closest below or at n
k = j * m (168)
and p, the sum of k and s (169 176 182)
then, if n is in p, it is Belgian, and not otherwise.
Another example:
n is 1234567898765
s is 1 3 6 10 15 21 28 36 45 53 60 66 71
m is 71
j is 17388280264
k is 1234567898744
p is 1234567898745 1234567898747 1234567898750 1234567898754
1234567898759 1234567898765 1234567898772 1234567898780 1234567898789
1234567898797 1234567898804 1234567898810 1234567898815
n is equal to the sixth item of p and so is Belgian.
Conversely, using the inverse of this logic, if (n - s)mod(m) contains
a 0, n is Belgian.
n - s
1234567898764 1234567898762 1234567898759 1234567898755 1234567898750
1234567898744 1234567898737 1234567898729 1234567898720 1234567898712
1234567898705 1234567898699 1234567898694
Notice that the sixth difference is k from the previous example.
(n - s) mod m
20 18 15 11 6 0 64 56 47 39 32 26 21
The sixth item is 0, so n is Belgian.
Eugene McDonnell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1459 bytes
Desc: not available
URL: <http://list.seqfan.eu/pipermail/seqfan/attachments/20050617/8384054a/attachment.bin>
More information about the SeqFan
mailing list