<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Combinatorics on Aakash Ghosh</title><link>https://ghoshaakash.pages.dev/tags/combinatorics/</link><description>Recent content in Combinatorics on Aakash Ghosh</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 11 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ghoshaakash.pages.dev/tags/combinatorics/rss.xml" rel="self" type="application/rss+xml"/><item><title>Project Euler #1: Multiples of 3 and 5</title><link>https://ghoshaakash.pages.dev/posts/project-euler-001/</link><pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate><guid>https://ghoshaakash.pages.dev/posts/project-euler-001/</guid><description>&lt;h2 id="problem">Problem&lt;/h2>
&lt;p>Find the sum of all &lt;strong>multiples of 3 or 5&lt;/strong> below 1000.&lt;/p>
&lt;h2 id="the-brute-force-and-why-we-dont-stop-there">The Brute Force (and Why We Don&amp;rsquo;t Stop There)&lt;/h2>
&lt;p>A simple loop works, of course:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>print(sum(x &lt;span style="color:#ff7b72">for&lt;/span> x &lt;span style="color:#ff7b72;font-weight:bold">in&lt;/span> range(&lt;span style="color:#a5d6ff">1000&lt;/span>) &lt;span style="color:#ff7b72">if&lt;/span> x &lt;span style="color:#ff7b72;font-weight:bold">%&lt;/span> &lt;span style="color:#a5d6ff">3&lt;/span> &lt;span style="color:#ff7b72;font-weight:bold">==&lt;/span> &lt;span style="color:#a5d6ff">0&lt;/span> &lt;span style="color:#ff7b72;font-weight:bold">or&lt;/span> x &lt;span style="color:#ff7b72;font-weight:bold">%&lt;/span> &lt;span style="color:#a5d6ff">5&lt;/span> &lt;span style="color:#ff7b72;font-weight:bold">==&lt;/span> &lt;span style="color:#a5d6ff">0&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>But the point of Project Euler isn&amp;rsquo;t the answer — it&amp;rsquo;s finding the clean mathematical structure underneath.&lt;/p>
&lt;h2 id="the-inclusion-exclusion-approach">The Inclusion-Exclusion Approach&lt;/h2>
&lt;p>Let $S(k, n)$ denote the sum of all multiples of $k$ strictly below $n$. Then:&lt;/p>
$$S(k, n) = k \cdot \sum_{i=1}^{\lfloor (n-1)/k \rfloor} i = k \cdot \frac{m(m+1)}{2}$$&lt;p>where $m = \lfloor (n-1)/k \rfloor$.&lt;/p></description></item><item><title>Project Euler #2: Even Fibonacci Numbers</title><link>https://ghoshaakash.pages.dev/posts/project-euler-002/</link><pubDate>Sat, 11 Apr 2026 00:00:00 +0000</pubDate><guid>https://ghoshaakash.pages.dev/posts/project-euler-002/</guid><description>&lt;h2 id="problem">Problem&lt;/h2>
&lt;p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. Starting with 1 and 2, the first 10 terms are:&lt;/p>
$$1, 2, 3, 5, 8, 13, 21, 34, 55, 89, \ldots$$&lt;p>Find the &lt;strong>sum of even-valued terms&lt;/strong> whose values do not exceed 4 million.&lt;/p>
&lt;h2 id="observation-which-fibonacci-numbers-are-even">Observation: Which Fibonacci Numbers Are Even?&lt;/h2>
&lt;p>Call the Fibonacci sequence $F_1 = 1, F_2 = 2, F_3 = 3, \ldots$.&lt;/p>
&lt;p>Looking at the parity pattern: &lt;strong>odd, even, odd, odd, even, odd, odd, even, $\ldots$&lt;/strong>&lt;/p></description></item></channel></rss>