How to resolve the algorithm Numbers which are the cube roots of the product of their proper divisors step by step in the 11l 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 11l 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 11l programming language

Source code in the 11l programming language

F product_of_proper_divisors(n)
   V prod = Int64(1)
   L(d) 2 .< Int(sqrt(n) + 1)
      I n % d == 0
         prod *= d
         V otherD = n I/ d
         I otherD != d
            prod *= otherD
   R prod

print(‘First 50 numbers which are the cube roots of the products of their proper divisors:’)
V found = 0
L(num) 1..
   I Int64(num) ^ 3 == product_of_proper_divisors(num)
      found++
      I found <= 50
         print(f:‘{num:3}’, end' I found % 10 == 0 {"\n"} E ‘ ’)
      E I found C (500, 5000, 50000)
         print(f:‘{commatize(found):6}th: {commatize(num)}’)
         I found == 50000
            L.break

  

You may also check:How to resolve the algorithm Send email step by step in the R programming language
You may also check:How to resolve the algorithm Super-d numbers step by step in the Rust programming language
You may also check:How to resolve the algorithm Literals/Integer step by step in the Plain English programming language
You may also check:How to resolve the algorithm Reflection/List methods step by step in the Julia programming language
You may also check:How to resolve the algorithm Bioinformatics/base count step by step in the JavaScript programming language