Commit 2020-06-08 15:06 47f73356
View on Github →feat(data/nat/digits): digits, and divisibility tests for Freek 85 (#2686)
I couldn't quite believe how much low hanging fruit there is on Lean's attempt at Freek's list, and so took a moment to do surely the lowest of the low...
This provides digits b n
, which extracts the digits of a natural number n
with respect to a base b
, and of_digits b L
, which reconstitutes a number from its digits, proves a few simple facts about these functions, and proves the usual divisibility by 3, 9, and 11 tests.