How to resolve the algorithm Radical of an integer step by step in the RPL programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Radical of an integer step by step in the RPL programming language

Table of Contents

Problem Statement

The radical of a positive integer is defined as the product of its distinct prime factors. Although the integer 1 has no prime factors, its radical is regarded as 1 by convention.
The radical of 504 = 2³ x 3² x 7 is: 2 x 3 x 7 = 42.

  1. Find and show on this page the radicals of the first 50 positive integers.
  2. Find and show the radicals of the integers: 99999, 499999 and 999999.
  3. By considering their radicals, show the distribution of the first one million positive integers by numbers of distinct prime factors (hint: the maximum number of distinct factors is 7).
    By (preferably) using an independent method, calculate the number of primes and the number of powers of primes less than or equal to one million and hence check that your answer in 3. above for numbers with one distinct prime is correct.

Let's start with the solution: