About 174,000 results
Open links in new tab
  1. Transform code to list perfect numbers from for loop to while loops

    Feb 8, 2025 · I am supposed to write a Python program that will identify and print all the perfect numbers in some closed interval [2, n], one per line. We only should use nested while loops …

  2. Python algorithm for finding perfect numbers - Stack Overflow

    Oct 24, 2018 · The first perfect number is 6. The next perfect number is 28. This is followed by the perfect numbers 496 and 8128. (Wikipedia) You have to exclude the number itself from the …

  3. Smart algorithm for finding perfect numbers - Stack Overflow

    Aug 26, 2022 · Is there an algorithm that is quicker than O(N^2) for finding perfect numbers from a sample 1:N? Or any general speed improvements to do less computation? I know we can …

  4. Finding Perfect Numbers Using Functions and Preset Code

    Oct 30, 2016 · I'm trying to write a program that will print perfect numbers between a range of 1-10,000, and list all of numbers that are divisible by the perfect number. I was given a preset of …

  5. java - Perfect Numbers in an ArrayList - Stack Overflow

    Aug 12, 2022 · This is an exercise. A perfect number is a number whose sum of divisors without itself is equal to that number 6 is a perfect number because its divisors are: 1,2,3,6 and 1 + 2 + …

  6. c - Perfect numbers between 1 and 1000 - Stack Overflow

    Aug 22, 2018 · 0 I don't understand why this program doesn't give any output. I just can't see the bug. This is a program to find every perfect number between 1 and 1000. Please help me find …

  7. python - Print all perfect numbers less than N - Stack Overflow

    Apr 29, 2022 · Using list comprehension, iterate the range of values (N-1) and test if each is perfect. The perfect numbers are captured and stored into the p variable as a list.

  8. Creating a function that checks perfect numbers python

    Oct 29, 2021 · A perfect number is any number that has the sum of it's devisors, excluding itself, equal to this number. Like the number six that is divided by 1, 2 and 3 and 1 + 2 + 3 = 6.

  9. Find Perfect Number using While loop in Python - Stack Overflow

    Aug 2, 2021 · Find Perfect Number using While loop in Python Asked 4 years, 5 months ago Modified 10 months ago Viewed 5k times

  10. python - A program that finds all four of the perfect numbers that …

    Jul 18, 2022 · -1 everyone. I have a question about an exercise from Brian Heinold's A Practical Introduction to Python Programming that reads "A number is called a perfect number if it is …