# 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?

How do I extract base(3) and index (15) from $3^{15$} in SageMath?

add a comment

2

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 +0200 **

Seen: **56 times**

Last updated: **Apr 16 '20**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.