Project Euler 24
Project Euler problem number #24 deals with permutations in lexicographical order. A non-brute force approach involves a mixed base number system based on factorials.
Project Euler problem number #24 deals with permutations in lexicographical order. A non-brute force approach involves a mixed base number system based on factorials.
To create the rotations I make a “detour” by converting the number into a string and then performing the rotations on the string.
A solution to Euler 48
Problems 18 and 67 differs in their size, where problem 67 is so large that a (naive) brute force algorithm would not end within reasonable time. A simple algorithm shows it self if we goes from the bottom up. The problem formulation displays the numbers such that one looks at the numbers from the top going down.
F# has a lot of functionality for manipulation of lists. Here is my first attempt at the solution in F#.
To solve problem #23 I apply simple brute force and we get to play a little with F# sets.