Author Message

Hi,

Quote:
> someone can help me please to understand what this program doing:

Absolutely nothing.

The program does for every x from 1 to 500 the following: It increases a
variable y from 1 to x/2, and counts every step, in which a certain
condition is true, in the veriable s. Obviously, the maximum value for
s must be x/2. Iff s = x (that is, never), x is printed out.

- Sebastian

--
This posting is sent in compliance with art. 22 of the German basic law.

Wed, 18 Jun 1902 08:00:00 GMT
what does the program do if you change line number 13 to read like this:

if x mod y = 0 then s:=s+y;

notice i've change the 1 with y in s:=s+y instead of s:=s+1

Quote:

>Hi,

>> someone can help me please to understand what this program doing:

>Absolutely nothing.

>The program does for every x from 1 to 500 the following: It increases a
>variable y from 1 to x/2, and counts every step, in which a certain
>condition is true, in the veriable s. Obviously, the maximum value for
>s must be x/2. Iff s = x (that is, never), x is printed out.

> - Sebastian

>--
>This posting is sent in compliance with art. 22 of the German basic law.

Wed, 18 Jun 1902 08:00:00 GMT
Hi,

Quote:
> what does the program do if you change line number 13 to read like this:

Is this going to be a quiz? I hope I can win something :-)

Quote:
> if x mod y = 0 then s:=s+y;

In this case, the program sums up all divisors of x, and stores the sum
in y. Therefore, the program prints out all numbers that are equal to all
their divisors summed up. I don't know what's so special about these
numbers, but then again I'm not a numbers expert.

- Sebastian

--

Wed, 18 Jun 1902 08:00:00 GMT

Quote:

>In this case, the program sums up all divisors of x, and stores the sum
>in y. Therefore, the program prints out all numbers that are equal to all
>their divisors summed up. I don't know what's so special about these
>numbers, but then again I'm not a numbers expert.

Those are called Perfect Numbers.

Jud McCranie

Wed, 18 Jun 1902 08:00:00 GMT
Hi,

Quote:
> Those are called Perfect Numbers.

few weeks ago.

- Sebastian

--