Specific number

Hi, i have written a program, i can tell which numbers are perfect, abundant or deficient. i can tell the percentages, and i can tell how many of these numbers i have. However, i don't know how to get an specific number, for example, if i enter 500, there are 3 perfect numbers, 6, 28, and 496. i need to be able to printout the actual numbers.