EP 241 Computer Programming
 


TE241 - Homework


Perfect Numbers

A perfect number,N, is a positive integer number whose sum of divisors excluding N itself equal to N.

For example:
     6 = 1 + 2 + 3
    28 = 1 + 2 + 4 + 7 + 14
   496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248

DO NOT USE Euclid method defined by the formula: 2n-1(2n - 1).

Write a Fortran program to list and count all prime numbers less than 10000.

SOLUTION