Skip to content

Commit 941efc3

Browse files
author
Juanitoupipou
committed
Merge branch 'Juan' of https://github.com/Miranda13/Python into Juan
2 parents 319b501 + 49b4546 commit 941efc3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

maths/special_numbers/proth_number.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def proth(number: int) -> int:
5959
return proth_list[number - 1]
6060

6161

62-
def isprothnumber(number: int) -> bool :
62+
def isprothnumber(number: int) -> bool:
6363
"""
6464
:param number: nth number to calculate in the sequence
6565
:return: true if number is a Proth number, false etherwise
@@ -79,16 +79,14 @@ def isprothnumber(number: int) -> bool :
7979
if number < 1:
8080
msg = f"Input value of [number={number}] must be > 0"
8181
raise ValueError(msg)
82-
82+
8383
num = number
8484
num -= 1
8585
n = 0
8686
while num%2 == 0 :
8787
num = num/2
8888
n += 1
89-
return num < (2**n)
90-
91-
89+
return num < (2**n)
9290

9391

9492
if __name__ == "__main__":
@@ -108,7 +106,7 @@ def isprothnumber(number: int) -> bool :
108106

109107
listexe = [3, 5, 9, 13, 49, 57, 193, 241, 163, 201]
110108

111-
for number in listexe :
109+
for number in listexe:
112110
if isprothnumber(number):
113111
print(f"{number} is a Proth number")
114112
else:

0 commit comments

Comments
 (0)