Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/centic9/multiplicativedigitalroot
This project plays with the mathematical topics of "Multiplicative digital roots" and "Multiplicative Persistence"
https://github.com/centic9/multiplicativedigitalroot
bigintegers digits mathematics multiplication
Last synced: 21 days ago
JSON representation
This project plays with the mathematical topics of "Multiplicative digital roots" and "Multiplicative Persistence"
- Host: GitHub
- URL: https://github.com/centic9/multiplicativedigitalroot
- Owner: centic9
- License: bsd-2-clause
- Created: 2019-10-03T16:06:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-14T23:07:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-17T05:09:16.290Z (about 1 month ago)
- Topics: bigintegers, digits, mathematics, multiplication
- Language: Java
- Size: 192 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/centic9/MultiplicativeDigitalRoot.svg)](https://travis-ci.org/centic9/MultiplicativeDigitalRoot)
[![Gradle Status](https://gradleupdate.appspot.com/centic9/MultiplicativeDigitalRoot/status.svg?branch=master)](https://gradleupdate.appspot.com/centic9/MultiplicativeDigitalRoot/status)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.## Theory
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/## Code
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## Change it
### Grab it
git clone https://github.com/centic9/MultiplicativeDigitalRoot.git
### Build it and run tests
cd MultiplicativeDigitalRoot
./gradlew check jacocoTestReport#### Licensing
* MultiplicativeDigitalRoot is licensed under the [BSD 2-Clause License].[BSD 2-Clause License]: https://www.opensource.org/licenses/bsd-license.php