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

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Giuga numbers step by step in the Arturo 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 Arturo programming language

Source code in the arturo programming language

giuga?: function [n]->
    and? -> not? prime? n
         -> every? factors.prime n 'f
            -> zero? (dec n/f) % f

print.lines select.first:4 1..=> giuga?


  

You may also check:How to resolve the algorithm Haversine formula step by step in the ATS programming language
You may also check:How to resolve the algorithm Caesar cipher step by step in the Vala programming language
You may also check:How to resolve the algorithm 99 bottles of beer step by step in the Lambdatalk programming language
You may also check:How to resolve the algorithm Four bit adder step by step in the Fortran programming language
You may also check:How to resolve the algorithm Apply a callback to an array step by step in the R programming language