Euler problems 18 and 67

Michael Jacobsen
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. Look at one “sub-triangle” at the bottom such as (the very left one)

Project Euler

Michael Jacobsen
F# has a lot of functionality for manipulation of lists. Here is my first attempt at the solution in F#. let numbers35 = List.filter (fun i - i % 3 = 0 or i % 5 = 0) [1 .. 999];; printfn "Euler project problem 1 : %d" (List.fold_left (+) 0 numbers35);; I could have merged the two lines into one. However, I find this a bit more clear. The filter function filters (!

Project Euler

Michael Jacobsen
To solve problem #23 I apply simple brute force and we get to play a little with F# sets. Find all abundant numbers below the given upper limit. Create a set of all sums of these numbers (with a small optimization where avoid computing both a+b and b+a). Then we make a set difference and sums the remaining elements. #light let n = seq { 1 .. 28123 } let abundant number = (List.

Two Monitors and AutoHotKey

Michael Jacobsen
I prefer to use the keyboard whenever possible. I have a two monitor setup and found myself moving windows from one monitor to the other using the mouse. However, using AutoHotKey I was able to do this by keyboard. Also I wanted to swithc easily to a particular window using the keaboard. Update: The functionality has now been integrated into Windows 7. AutoHotKey is an utility for creating hot keys. Each hot key can runs a command or a small script.

Average Distance on a Line

Michael Jacobsen
As warm-up to the question of average distance between two points on a circle I’ll start out finding the average distance between two points on a line. For one particular point x we have an average distance to n other points as $$ \sum_{i=1}^n | x - y_i | \frac{1}{n} $$ where we sum each distance times its probability (1/n). If take ``all points’’ on line of unit length we get a Rieman Integral, that is

Heat - Remote Sensing of Temperature

Michael Jacobsen
The problem is to deduce how the temperature changes (we will call this a temperature profile) at one place from measurements at another place. We restrict ourselves to a 1-D problem. Assume that we can apply a temperature profile (f(t)) to the end of a rod (at the position x = 0). We now define the forward problem that gives the temperature profile at any point by means of a Partial Differential Equation (PDE):

Michael Jacobsen
Title: My iPad Apps Author: Michael Jacobsen Date: 2011-01-16 Tags: list The iPad app-store is not the best with respect to search and comparison of the overwhelming number of available apps. This small entry lists the applications that I use the most or that I expect to use more. Dropbox - many things have been said. It is a must have Note Taker HD - has a nice solution to note taking.

Michael Jacobsen
Author: Michael Jacobsen Date: 2012-04-09 Updated: 2013-01-08 Title: Online courses Tags: lists Category: lists The Khan Academy (link) was a pioneer in online learning. However, online learning really picked up speed in 2011 when a number of Stanford professors started a number of freely available online classes. I see it as a possibility to learn stuff in a structured way as a side project next to work. As I participate in courses I will add them to the following list with some remarks about my impression.