Ask Your Question
0

How to print positive integers that divides a number without a remainder?

asked 4 years ago

Robert H gravatar image

Hi,

Is there a function in Sage that prints all the positive integers that divides without a remainder?

I am using factor() but I think it only shows the prime factorization.

For example, using factor(54) returns 2 * 3^3 in Sage but all the positive integers are:

1 × 54 = 54    
2 × 27 = 54
3 × 18 = 54
6 × 9 = 54
9 × 6 = 54
18 × 3 = 54
27 × 2 = 54
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 4 years ago

rburing gravatar image
sage: divisors(54)
[1, 2, 3, 6, 9, 18, 27, 54]
Preview: (hide)
link

Comments

Thank you!

Robert H gravatar imageRobert H ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 226 times

Last updated: Feb 03 '21