Question
Magical Number
A number is called magical if it is a power of 4.
You are given an integer n
, and your task is to check whether it is a magical number.
Formally, Print True if there exists a non-negative integer k
such that:
n = 4k
Otherwise, Print False.
Input
A single integer n.
Output
Print "True" (without quotes) if n is a power of 4.
Print "False" otherwise.
Print "False" otherwise.
Example
Input:
16
Output:
True
Explanation:
42 = 16
Input:
12
Output:
False
Explanation:
12 is not a power of 4.
16
Output:
True
Explanation:
42 = 16
Input:
12
Output:
False
Explanation:
12 is not a power of 4.