Skip to content

tommilligan/multiplicative-persistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiplicative-persistence

CircleCI branch

Search for integers with high multiplicative persistence values.

Installation

This project uses the standard rustup and cargo toolchain. Originally tested against rustc 1.33.0.

Usage

Build binaries with cargo build --release --bins, they will be output in target/release:

  • mpersist
    • for: get the multiplicative persistence of any positive integer
    • list: get the multiplicative persistence of values in a range
    • search: look for the smallest integer with the largest multiplicative persistence value
  • mp-visualize

Data generation

./mpersist for 12     # 1
./mpersist -- for 77  # 4
./mpersist search
3 39
4 77
# etc.

# Search for mp values
# - starting with integers 233 digits in length
# - search for 10 rounds (i.e. search up to 243 digits in length)
# - use 4 threads
./mpersist search -f 233 -n 10 -t 4
# this might take some time!

Visualization

For visualization examples, see the example directory. The mp-visualize binary reads the output of mpersist list from stdin, and lays it out in a Sacks spiral.

./mpersist list 0 3500 | ./mp-visualize default.png
./mpersist list 0 100000 | ./mp-visualize -d 0.5 -a 0.25 -r 4 -f 2.0 -w 900 shockwave.png
./mpersist list 0 25000 | ./mp-visualize -d 0.25 -a 0.25 -r 3.5 stars.png

visualization up to 3500

A visualisation of the first 3500 integers and their mp values

About

Calculate multiplicative persistence of big numbers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •