Question: linux1[150] $ python3 perfection.py Enter the number to check for perfection: 33550336 The number is perfect! 1 + 2 + 4 + 8 + 16

 linux1[150] $ python3 perfection.py Enter the number to check for perfection:

linux1[150] $ python3 perfection.py Enter the number to check for perfection: 33550336 The number is perfect! 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + 2048 + 4096 + 8191 + 16382 + 32764 + 65528 + 131056 + 262112 + 524224 + 1048448 + 2096896 + 4193792 + 8387584 + 16775168 = 33550336 linux1[151] % python3 perfection.py Enter the number to check for perfection: 123 The number isn't perfect! 1 + 3 + 41 = 45 linux1[152] % python3 perfection.py Enter the number to check for perfection: 28 The number is perfect! 1 + 2 + 4 + 7 + 14 = 28 linux1[153] $ python3 perfection.py Enter the number to check for perfection: 8127 The number isn't perfect! 1 + 3 + 7 + 9 + 21 + 27 + 43 + 63 + 129 + 189 + 301 + 387 + 903 + 1161 + 2709 = 5953

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!