How to resolve the algorithm O'Halloran numbers step by step in the XPL0 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm O'Halloran numbers step by step in the XPL0 programming language

Table of Contents

Problem Statement

For this task, for our purposes, a cuboid is a 3 dimensional object, with six rectangular faces, where all angles are right angles, opposite faces of the cuboid are equal, and where each dimension is a positive integer unit length. It will subsequently be referred to simply as a cuboid; but be aware that it references the above definition. The surface area of a cuboid is two times the length times the width, plus two times the length times the height, plus two times the width times the height. A cuboid will always have an even integer surface area. The minimum surface area a cuboid may have is 6; one where the l, w, and h measurements are all 1. Different cuboid configurations (may) yield different surface areas, but the surface area is always an integer and is always even. A cuboid with l = 2, w = 1 h = 1 has a surface area of 10 There is no configuration which will yield a surface area of 8. There are 16 known even integer values below 1000 which can not be a surface area for any integer cuboid. It is conjectured, though not rigorously proved, that no others exist. that can not be the surface area of a cuboid.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm O'Halloran numbers step by step in the XPL0 programming language

Source code in the xpl0 programming language

int  L, W, H, HA, I;
char T(1000/2);                 \table of half areas
[for I:= 0 to 1000/2-1 do
        T(I):= true;            \assume all are O'Halloran numbers
for L:= 1 to 250 do
    for W:= 1 to 250/L do
        for H:= 1 to 250/L do
            [HA:= L*W + L*H + W*H;
            if HA < 500 then    \not an O'Halloran number
                T(HA):= false;
            ];
for I:= 6/2 to 1000/2-1 do
    if T(I) then
        [IntOut(0, I*2);  ChOut(0, ^ )];
]

  

You may also check:How to resolve the algorithm Hello world/Text step by step in the PIR programming language
You may also check:How to resolve the algorithm Fibonacci n-step number sequences step by step in the Java programming language
You may also check:How to resolve the algorithm Reverse a string step by step in the PostScript programming language
You may also check:How to resolve the algorithm Terminal control/Display an extended character step by step in the COBOL programming language
You may also check:How to resolve the algorithm Sorting algorithms/Stooge sort step by step in the BCPL programming language