By Peter Prevos
Raising number to a power can have interesting results. The video below explains why this pandigital formula approximates to billions of decimals:
Euler Problem 29 Definition
Consider all integer combinations of: for and .
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
How many distinct terms are in the sequence generated by for and ?
Brute Force Solution
This code simply calculates all powers from to and determines the number of unique values. Since we are only interested in their uniqueness and not the precise value, there is no need to use Multiple Precision Arithmetic.
# Initialisation target
To leave a comment for the author, please follow the link and comment on their blog: The Devil is in the Data.
R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...
Source:: R News