Project Euler 35
To create the rotations I make a “detour” by converting the number into a string and then performing the rotations on the string.
To create the rotations I make a “detour” by converting the number into a string and then performing the rotations on the string.
The familiar for loop featured in most if not all impertive langagues is not part of most functional languages if any because it has the mutable loop index. The standard way of looping in F# is to use recursion.
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#.