Skip to content

arakanic/persistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

persistence

The function persistence takes a positive parameter integer and returns its multiplicative persistence, the number of times its digits are multiplied until a single digit is reached.

For example (Input --> Output):

39 --> 3 (because 39 = 27, 27 = 14, 1*4 = 4 and 4 has only one digit)

999 --> 4 (because 999 = 729, 729 = 126, 126 = 12, and finally 1*2 = 2)

4 --> 0 (because 4 is already a one-digit number)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published