How do I extract base(3) and index (15) from $3^{15}$ in SageMath?
How do I extract base(3) and index (15) from $3^{15$} in SageMath?
How do I extract base(3) and index (15) from $3^{15$} in SageMath?
You can use the is_prime_power
method:
sage: a = 3**15
sage: a.is_prime_power()
True
sage: a.is_prime_power(get_data=True)
(3, 15)
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2020-04-16 16:24:00 +0100
Seen: 235 times
Last updated: Apr 16 '20