# 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

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)
```

Asked: **
2020-04-16 09:24:00 -0500
**

Seen: **34 times**

Last updated: **Apr 16**

Mapping 2-dimensional matrix index to a list [closed]

matrix base ring changes by a complex multiplication

How converting some number of different base to 10 to base 10?

Is there a routine to find a integer base?

integer digits range problem (see sage error below) Thanks!!!

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.