12.07.2015 Views

CSCE 314 Programming Languages - TAMU Computer Science ...

CSCE 314 Programming Languages - TAMU Computer Science ...

CSCE 314 Programming Languages - TAMU Computer Science ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(2)A positive integer is perfect if it equals thesum of all of its factors, excluding the numberitself. Using a list comprehension, define afunctionperfects :: Int → [Int]that returns the list of all perfect numbersup to a given limit. For example:> perfects 500[6,28,496]32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!