How to resolve the algorithm Giuga numbers step by step in the EasyLang programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Giuga numbers step by step in the EasyLang programming language

Table of Contents

Problem Statement

A Giuga number is a composite number n which is such that each of its distinct prime factors f divide (n/f - 1) exactly. All known Giuga numbers are even though it is not known for certain that there are no odd examples. 30 is a Giuga number because its distinct prime factors are 2, 3 and 5 and:

Determine and show here the first four Giuga numbers. Determine the fifth Giuga number and any more you have the patience for.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Giuga numbers step by step in the EasyLang programming language

Source code in the easylang programming language

func giuga m .
   n = m
   for f = 2 to sqrt n
      while n mod f = 0
         if (m div f - 1) mod f <> 0
            return 0
         .
         n = n div f
         if f > n
            return 1
         .
      .
   .
.
n = 3
while cnt < 4
   if giuga n = 1
      cnt += 1
      print n
   .
   n += 1
.

  

You may also check:How to resolve the algorithm Faulhaber's triangle step by step in the REXX programming language
You may also check:How to resolve the algorithm Rot-13 step by step in the FBSL programming language
You may also check:How to resolve the algorithm Empty directory step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Detect division by zero step by step in the Julia programming language
You may also check:How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the Tcl programming language