Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created October 17, 2022 01:17
Show Gist options
  • Select an option

  • Save galenseilis/02e562eba971d3e07a859911bcb7f7b9 to your computer and use it in GitHub Desktop.

Select an option

Save galenseilis/02e562eba971d3e07a859911bcb7f7b9 to your computer and use it in GitHub Desktop.
Recursively multiply digits of a number's digits of....
import numpy as np
def mult_pers(n):
if len(str(n)) == 1:
return n
else:
prod = np.prod([int(i) for i in str(n)])
return mult_pers(prod)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment