aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/andinus/README
blob: 1d5171cfa85a1648333079844a74e63b9aa35aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
                            ━━━━━━━━━━━━━━━
                             CHALLENGE 134

                                Andinus
                            ━━━━━━━━━━━━━━━


                               2021-10-11





Task 1 - Pandigital Numbers
═══════════════════════════

  Write a script to generate first 5 Pandigital Numbers in base 10.

  As per the [wikipedia], it says:

        A pandigital number is an integer that in a given base has
        among its significant digits each digit used in the base
        at least once.


[wikipedia] <https://en.wikipedia.org/wiki/Pandigital_number>

Raku
────

  • Program: <file:raku/ch-1.raku>

  Loop from 1023456789 (first Pandigital Number) and take if it contains
  every digit in base 10.

  ┌────
  │ put gather for 1023456789 .. ∞ {
  │     .take if .comb>>.Int.Set ≡ (0 .. 9).Set;
  │ }[^5]
  └────