How to resolve the algorithm Composite numbers k with no single digit factors whose factors are all substrings of k step by step in the Raku programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Composite numbers k with no single digit factors whose factors are all substrings of k step by step in the Raku programming language

Table of Contents

Problem Statement

Find the composite numbers k in base 10, that have no single digit prime factors and whose prime factors are all a substring of k.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Composite numbers k with no single digit factors whose factors are all substrings of k step by step in the Raku programming language

Source code in the raku programming language

use Prime::Factor;
use Lingua::EN::Numbers;

put (2..∞).hyper(:5000batch).map( {
    next if (1 < $_ gcd 210) || .is-prime || any .&prime-factors.map: -> $n { !.contains: $n };
    $_
} )[^20].batch(10)».&comma».fmt("%10s").join: "\n";


  

You may also check:How to resolve the algorithm Suffixation of decimal numbers step by step in the VBA programming language
You may also check:How to resolve the algorithm Closest-pair problem step by step in the Perl programming language
You may also check:How to resolve the algorithm List comprehensions step by step in the Python programming language
You may also check:How to resolve the algorithm Comments step by step in the Sidef programming language
You may also check:How to resolve the algorithm Memory allocation step by step in the Python programming language