UP / HOME

Challenge 134

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.

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]

Andinus / 2021-10-11 / Modified: 2021-10-11 Mon 20:57 Emacs 27.2 (Org mode 9.4.4)