This project plays with the mathematical topics of "Multiplicative digital roots" and "Multiplicative Persistence", see https://en.wikipedia.org/wiki/Multiplicative_digital_root and https://en.wikipedia.org/wiki/Persistence_of_a_number for more information.
It determines the smallest number for each multiplicative persistence using Java and BigInteger or byte-arrays, exploring limits of handling large numbers with BigIntegers and comparing performance to other approaches.
There is a conjecture that there is no multiplicative persistence of a number higher than 11
See https://oeis.org/A007954 and https://oeis.org/A003001 for related mathematical series
More information on this topic:
- https://de.wikipedia.org/wiki/Querprodukt (German)
- https://www.spektrum.de/kolumne/behaglich-beharrliche-berechnungen/1643996 (German)
- https://arxiv.org/abs/1307.1188
- http://mathworld.wolfram.com/MultiplicativePersistence.html
- http://neilsloane.com/doc/persistence.html
- http://web.archive.org/web/20050214141815/http://www.wschnei.de/digit-related-numbers/persistence.html
- https://www.youtube.com/watch?v=Wim9WJeDTHQ
- http://www41.homepage.villanova.edu/robert.styer/MultiplicativePersistence/PersistenceStephPerezJournalArtAug2013.pdf
- http://markdiamond.com.au/download/joous-3-1-1.pdf
- https://www.tandfonline.com/doi/abs/10.1080/10586458.2014.910849
- https://www.linkedin.com/pulse/calculating-multiplicative-persistence-efficiently-cecil-westerhof/?trk=public_profile_article_view
- https://opensourc.es/blog/persistence/
This project currently implements two ways of computing the multiplicative persistence of numbers.
The first version at MultiplicativeDigitalRoot
uses Strings and BigIntegers to handle large numbers, but this is
obviously rather inefficient and limits the number of checks that can be performed.
The second version at MultiplicativeDigitalRootByteArray
represents the digits of the number in a byte-array which
allows to perform some of the operations much quicker. It also optimizes incrementing the number a lot to check
much less numbers and skip large sections of numbers that are not relevant anyway.
The third version at MultiplicativeDigitalRootClass
is similar to the previous one but
extracts code into a class ByteArrayInteger
which encapsulates the handling of
git clone https://github.com/centic9/MultiplicativeDigitalRoot.git
cd MultiplicativeDigitalRoot
./gradlew check jacocoTestReport
- MultiplicativeDigitalRoot is licensed under the BSD 2-Clause License.