How to resolve the algorithm Sequence: smallest number greater than previous term with exactly n divisors step by step in the EasyLang programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Sequence: smallest number greater than previous term with exactly n divisors step by step in the EasyLang programming language

Table of Contents

Problem Statement

Calculate the sequence where each term an is the smallest natural number greater than the previous term, that has exactly n divisors.

Show here, on this page, at least the first 15 terms of the sequence.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sequence: smallest number greater than previous term with exactly n divisors step by step in the EasyLang programming language

Source code in the easylang programming language

func ndivs n .
   i = 1
   while i <= sqrt n
      if n mod i = 0
         cnt += 2
         if i = n div i
            cnt -= 1
         .
      .
      i += 1
   .
   return cnt
.
n = 1
while n <= 15
   i += 1
   if n = ndivs i
      write i & " "
      n += 1
   .
.

  

You may also check:How to resolve the algorithm Least common multiple step by step in the Ursa programming language
You may also check:How to resolve the algorithm Walk a directory/Non-recursively step by step in the Lingo programming language
You may also check:How to resolve the algorithm HTTPS/Client-authenticated step by step in the Tcl programming language
You may also check:How to resolve the algorithm Polynomial long division step by step in the C programming language
You may also check:How to resolve the algorithm Arithmetic/Complex step by step in the Dart programming language