<jupyter_start><jupyter_text><jupyter_code>import math

def get_power_of_p(n, p):
  ans = 0
  while (n % p) == 0:
    ans += 1
    n /= p
  return math.floor(ans)

def check_if_array_numbers_can_be_made_equal(a):
  n, prev = len(a), 0
  for i in range(n):
    p2 = get_power_of_p(a[i], 2)
    p7 = get_power_of_p(a[i], 7)
    a[i] /= ((2**p2) * (7**p7))
    print("Residual = " + str(a[i]) + ", Power of 2 = " + str(p2) + ", Power of 7 = " + str(p7))
    if i > 0:
      if a[i] != prev:
        return "No"
    prev = a[i]
  return "Yes"

print(check_if_array_numbers_can_be_made_equal([128, 4, 2]))<jupyter_output>Residual = 1.0, Power of 2 = 7, Power of 7 = 0
Residual = 1.0, Power of 2 = 2, Power of 7 = 0
Residual = 1.0, Power of 2 = 1, Power of 7 = 0
Yes
{'fraction_non_alphanumeric': 0.17105263157894737, 'fraction_numerical': 0.05263157894736842, 'mean_word_length': 2.94300518134715, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '240336', 'license': 'MIT', 'n_tokens_mistral': 380, 'n_tokens_neox': 349, 'n_words': 91, 'path': 'check_if_numbers_in_array_canbe_made_equal.ipynb', 'repo_name': 'saint1729/DataScieneInterviewPrep', 'size': '760'}