1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vladimir2022 [97]
3 years ago
12

A positive integer is called a perfect number if it is equal to the sum of all of its positive divisors, excluding itself. For e

xample, 6 is the first perfect number because 6 = 3 + 2 + 1. The next is 28 = 14 + 7 + 4 + 2 + 1. There are four perfect numbers less than 10,000. Write a program to find all these four numbers.
Computers and Technology
1 answer:
Ad libitum [116K]3 years ago
5 0

i = 1

while i < 10001:

   total = 0

   x = 1

   while x < i:

       if i % x == 0:

           total += x

       x+=1

   if total == i:

       print(str(i)+" is a perfect number")

   i += 1

When you run this code, you'll see that 6, 28, 496, and 8128 are all perfect numbers.

You might be interested in
How does computer network work in a paragraph
Maksim231197 [3]

You go in to the networks crosh/Linux and you insert the info you want in code

7 0
3 years ago
An additional factor in how an element is rendered is that properties are passed from a parent element to its children in a proc
belka [17]

Answer:

style inheritance

Explanation:

What happens when a property on an element has no value supplied is governed by style inheritance. A property should inherit its value from its parent element, according to this specification.

6 0
2 years ago
Hey, how do we get our warnings removed? I got one and I didn't realize that what I did was wrong.
vodka [1.7K]

Sorry we can't remove our warnings

5 0
2 years ago
Read 2 more answers
What does www stand for?
Temka [501]
Www stands for world wide web
3 0
3 years ago
Read 2 more answers
A public Wi-Fi risk that can be minimized by only visiting
lord [1]

Answer

it is B

Explanation:

because i had the test and i picked that

6 0
3 years ago
Other questions:
  • I have a question about a hotel tv:
    10·1 answer
  • What is the full form of the acronym WWW?
    13·2 answers
  • High-speed memory that reduces the frequency of access by the cpu to conventional memory is called
    12·1 answer
  • Without protocols the information sent and received through the Internet would never reach its intended target and even if it di
    6·1 answer
  • When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if
    7·1 answer
  • The first step to accurate coding is to identify the ___________ in the diagnostic statement.
    7·1 answer
  • The illustration shows different types of text language.
    5·2 answers
  • Create a method called letterGrade that will pass the student's average grade as a parameter and return a letter grade (char). O
    12·1 answer
  • What is the bandwidth for asymmetric digital subscriber line<br> (ADSL)?
    10·2 answers
  • Which tags do you use to write the header and items of an ordered list on a web page?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!