<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Math on Josiah Wood</title><link>https://josiahwood.com/categories/math/</link><description>Recent content in Math on Josiah Wood</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 06 Nov 2018 23:17:18 +0000</lastBuildDate><atom:link href="https://josiahwood.com/categories/math/index.xml" rel="self" type="application/rss+xml"/><item><title>Project Euler Problem 2: Even Fibonacci numbers</title><link>https://josiahwood.com/project-euler-problem-2-even-fibonacci-numbers/</link><pubDate>Tue, 06 Nov 2018 23:17:18 +0000</pubDate><guid>https://josiahwood.com/project-euler-problem-2-even-fibonacci-numbers/</guid><description>&lt;p&gt;&lt;a href="https://projecteuler.net/problem=2"&gt;Project Euler Problem 2&lt;/a&gt; instructs:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:&lt;/p&gt;&#10;&lt;p&gt;1, 2, 3, 5, 8, 13, 21, 34, 55, 89, &amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;They&amp;rsquo;ve already given you the definition of the Fibonacci sequence (except it is usually written as starting with 0,1 or 1,1). So the first thing to figure out is how do we find the sequence of even-valued terms.&lt;/p&gt;</description></item><item><title>Project Euler Problem 1: Multiples of 3 and 5</title><link>https://josiahwood.com/project-euler-problem-1-multiples-of-3-and-5/</link><pubDate>Wed, 25 May 2016 10:34:00 +0000</pubDate><guid>https://josiahwood.com/project-euler-problem-1-multiples-of-3-and-5/</guid><description>&lt;p&gt;&lt;a href="https://projecteuler.net/problem=1"&gt;Project Euler Problem 1&lt;/a&gt; instructs:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;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.&lt;/p&gt;&#10;&lt;p&gt;Find the sum of all the multiples of 3 or 5 below 1000.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This ends up being a basic math problem, so no code is needed yet.&lt;/p&gt;&#10;&lt;p&gt;I think the easiest way to think of this is as a variation on triangular numbers. Triangular numbers are the sums of the first &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class="katex-html" aria-hidden="true"&gt;&lt;span class="katex-base"&gt;&lt;span class="katex-strut" style="height:0.4306em;"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; natural numbers. Which is a very similar description to our problem statement. The initial formula for triangular numbers is:&lt;/p&gt;</description></item><item><title>Twelve Men on an Island Logic Puzzle</title><link>https://josiahwood.com/twelve-men-on-an-island-logic-puzzle/</link><pubDate>Fri, 20 May 2016 16:47:53 +0000</pubDate><guid>https://josiahwood.com/twelve-men-on-an-island-logic-puzzle/</guid><description>&lt;p&gt;One of my favorite shows right now is Brooklyn Nine-Nine. During season 2 episode 18, titled &amp;ldquo;Captain Peralta&amp;rdquo;, Captain Holt presents this riddle to the team:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;There are twelve men on an island. Eleven weigh exactly the same amount, but one of them is slightly lighter or heavier. You must figure out which. The island has no scales, but there is a seesaw. You can only use it three times.&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This isn&amp;rsquo;t exactly a programming post, but it does demonstrate the same kind of problem solving that is often found in devising efficient algorithms.&lt;/p&gt;</description></item></channel></rss>