Ask Your Question
0

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

asked 2021-02-03 18:54:33 +0200

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
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-02-03 19:01:30 +0200

rburing gravatar image
sage: divisors(54)
[1, 2, 3, 6, 9, 18, 27, 54]
edit flag offensive delete link more

Comments

Thank you!

Robert H gravatar imageRobert H ( 2021-02-03 19:07:46 +0200 )edit

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: 2021-02-03 18:54:33 +0200

Seen: 40 times

Last updated: Feb 03