Back
Close
  • 7

Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

Statement

 Goal

Let n be a positive integer. A "beautiful base" of n is any integer b > 1 such that log_⁡b(n) is an integer > 1, where log_b(n) denotes the logarithm of n in base b.

Find the beautiful base B of n such that log_⁡B(n) is as large as possible. We shall refer to B as the "most beautiful base" of n.
Input
An integer n.
Output
The most beautiful base of n if it exists otherwise NONE.
Constraints
1 <= n <= 10 ^ 18
Example
Input
1
Output
NONE

A higher resolution is required to access the IDE