maths.special_numbers.weird_number

https://en.wikipedia.org/wiki/Weird_number

Fun fact: The set of weird numbers has positive asymptotic density.

Functions

abundant(→ bool)

factors(→ list[int])

semi_perfect(→ bool)

weird(→ bool)

Module Contents

maths.special_numbers.weird_number.abundant(n: int) bool
>>> abundant(0)
True
>>> abundant(1)
False
>>> abundant(12)
True
>>> abundant(13)
False
>>> abundant(20)
True

# >>> abundant(-12) # True

maths.special_numbers.weird_number.factors(number: int) list[int]
>>> factors(12)
[1, 2, 3, 4, 6]
>>> factors(1)
[1]
>>> factors(100)
[1, 2, 4, 5, 10, 20, 25, 50]

# >>> factors(-12) # [1, 2, 3, 4, 6]

maths.special_numbers.weird_number.semi_perfect(number: int) bool
>>> semi_perfect(0)
True
>>> semi_perfect(1)
True
>>> semi_perfect(12)
True
>>> semi_perfect(13)
False

# >>> semi_perfect(-12) # True

maths.special_numbers.weird_number.weird(number: int) bool
>>> weird(0)
False
>>> weird(70)
True
>>> weird(77)
False