diff options
| author | Abigail <abigail@abigail.be> | 2021-01-27 22:28:58 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-01-27 22:28:58 +0100 |
| commit | 6c4abf9a6115c3f7a26e3ade66c2ad03f88d5c54 (patch) | |
| tree | f6422950b3ea1e54fa42c147c1c286533c393a1c | |
| parent | 0bc9b6c97af0f2db908a6961b5a069219fcea5d0 (diff) | |
| download | perlweeklychallenge-club-6c4abf9a6115c3f7a26e3ade66c2ad03f88d5c54.tar.gz perlweeklychallenge-club-6c4abf9a6115c3f7a26e3ade66c2ad03f88d5c54.tar.bz2 perlweeklychallenge-club-6c4abf9a6115c3f7a26e3ade66c2ad03f88d5c54.zip | |
Notes for week 3, part 1
| -rw-r--r-- | challenge-003/abigail/README.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-003/abigail/README.md b/challenge-003/abigail/README.md index 96ebd691af..9801393564 100644 --- a/challenge-003/abigail/README.md +++ b/challenge-003/abigail/README.md @@ -6,6 +6,18 @@ are less or equal to `5`. They are also called Hamming/Regular/Ugly numbers. For more information, please check this [wikipedia](https://en.wikipedia.org/wiki/Regular_number). +### Notes +We are going to generate all numbers `n = 2^i * 3^j * 5^k`, with +`i >= 0`, `j >= 0`, `k >= 0`, and `n <= MAX`, where `MAX` is read +from `STDIN`. No other numbers are generated. + +We are *not* going to generate the numbers `n` in +numerical order. Instead, if we have two numbers `n1 = 2^i1 * 3^j1 * 5^k1`, +and `n2 = 2^i2 * 3^j2 * 5^k2`, then `n1` is generated before `n2`, iff + + i1 < i2 || + i1 == i2 && j1 < j2 || + i1 == i2 && j1 == j2 && k1 < k2 ### Solutions * [AWK](awk/ch-1.awk) |
