FiSGO.PrimesHandler.is_power

is_power(n, d)[source]

Given two integers n and d, returns True if there exists a positive integer m such that n = d**m, returns False otherwise.

Parameters:
  • n (int) – Integer.

  • d (int) – Integer.

Return type:

bool

Returns:

Boolean, True if n is power of d, False otherwise.