How to resolve the algorithm Numbers which are the cube roots of the product of their proper divisors step by step in the Raku programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Numbers which are the cube roots of the product of their proper divisors step by step in the Raku programming language
Table of Contents
Problem Statement
Consider the number 24. Its proper divisors are: 1, 2, 3, 4, 6, 8 and 12. Their product is 13,824 and the cube root of this is 24. So 24 satisfies the definition in the task title. Compute and show here the first 50 positive integers which are the cube roots of the product of their proper divisors. Also show the 500th and 5,000th such numbers. Compute and show the 50,000th such number. OEIS considers 1 to be the first number in this sequence even though, strictly speaking, it has no proper divisors. Please therefore do likewise.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Numbers which are the cube roots of the product of their proper divisors step by step in the Raku programming language
Source code in the raku programming language
use Prime::Factor;
use Lingua::EN::Numbers;
my @cube-div = lazy 1, |(2..∞).hyper.grep: { .³ == [×] .&proper-divisors }
put "First 50 numbers which are the cube roots of the products of their proper divisors:\n" ~
@cube-div[^50]».fmt("%3d").batch(10).join: "\n";
printf "\n%16s: %s\n", .Int.&ordinal.tc, comma @cube-div[$_ - 1] for 5e2, 5e3, 5e4;
You may also check:How to resolve the algorithm Catalan numbers step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Non-decimal radices/Convert step by step in the Erlang programming language
You may also check:How to resolve the algorithm P-value correction step by step in the Java programming language
You may also check:How to resolve the algorithm Averages/Pythagorean means step by step in the Ring programming language
You may also check:How to resolve the algorithm 2048 step by step in the C programming language