solve for prime

Warren HansenUncategorizedLeave a Comment

A friend of mine was administering a whiteboard test to a prospective hire. He asked what he thought was a straightforward question. Can you write a function to solve for prime? The young lion fumbled around and offered that he thought there was a pre-defined one function from .Net. He never produced a working function and was never hired. This … Read More

exploring fibonacci in swift

Warren HansenalgorithmsLeave a Comment

I’ve been interested in Fibonacci ever since I became involved in the world of financial trading. I’ve written a few algos before that look for cycles in financial instruments but never applied fibs to them. Also known as the golden ratio this formula¬†of repeating numbers has shown up in many different disciplines.¬†Fibonacci examples are plentiful in geometry… and music. Fibs … Read More

multiples of 3 and 5

Warren HansenalgorithmsLeave a Comment

I like love working with algorithms. Concept: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Test: Find the sum of all the multiples of 3 or 5 below 1000. A solution I came up with in swift to … Read More