<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Liam Foster</title>
    <description>The latest articles on DEV Community by Liam Foster (@liamfoster_guides37).</description>
    <link>https://dev.to/liamfoster_guides37</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4159482%2F3545b646-881d-435c-b90b-4c1c8994df21.png</url>
      <title>DEV Community: Liam Foster</title>
      <link>https://dev.to/liamfoster_guides37</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/liamfoster_guides37"/>
    <language>en</language>
    <item>
      <title>GCD and LCM Explained: Two Tricks That Make Number Problems Easy</title>
      <dc:creator>Liam Foster</dc:creator>
      <pubDate>Sat, 03 Oct 2026 18:58:43 +0000</pubDate>
      <link>https://dev.to/liamfoster_guides37/gcd-and-lcm-explained-two-tricks-that-make-number-problems-easy-5fjf</link>
      <guid>https://dev.to/liamfoster_guides37/gcd-and-lcm-explained-two-tricks-that-make-number-problems-easy-5fjf</guid>
      <description>&lt;p&gt;Two of the most useful ideas in basic math are the greatest common divisor (GCD) and the least common multiple (LCM). They show up in school homework, coding interviews, and everyday puzzles like figuring out when two repeating events line up. This guide explains both with simple examples you can do in your head.&lt;/p&gt;

&lt;p&gt;The GCD of two numbers is the largest number that divides both of them evenly. For 12 and 18, the common divisors are 1, 2, 3, and 6, so the GCD is 6. Listing every divisor works for small numbers, but there is a smarter way for bigger ones: Euclid's algorithm.&lt;/p&gt;

&lt;p&gt;Euclid's algorithm is over two thousand years old and still the fastest simple method. To find the GCD of 48 and 18, divide 48 by 18 and take the remainder: 48 = 2 x 18 + 12. Now replace the pair (48, 18) with (18, 12) and repeat: 18 = 1 x 12 + 6. Repeat again with (12, 6): 12 = 2 x 6 + 0. When the remainder hits zero, the last non-zero remainder is the GCD. So GCD(48, 18) = 6.&lt;/p&gt;

&lt;p&gt;The LCM is the flip side: the smallest number that is a multiple of both. For 4 and 6, the multiples of 4 are 4, 8, 12, 16, and the multiples of 6 are 6, 12, 18, so the LCM is 12. Here is the trick that saves you from listing: LCM(a, b) = (a x b) / GCD(a, b). For 4 and 6, that is (4 x 6) / 2 = 12. Compute one, get the other free.&lt;/p&gt;

&lt;p&gt;Let us try a bigger pair by hand: 36 and 48. Euclid's algorithm: 48 = 1 x 36 + 12, then 36 = 3 x 12 + 0, so GCD = 12. Then LCM = (36 x 48) / 12 = 1728 / 12 = 144. Check it: 144 / 36 = 4 and 144 / 48 = 3, both whole numbers. Correct.&lt;/p&gt;

&lt;p&gt;Where does this come up in real life? Adding fractions needs a common denominator, which is the LCM of the denominators. Simplifying a fraction to lowest terms means dividing top and bottom by their GCD. Two buses that leave every 12 and 18 minutes meet every LCM(12, 18) = 36 minutes. The same idea schedules tasks, syncs animations, and compresses data in code.&lt;/p&gt;

&lt;p&gt;If you want to double-check your hand calculations or work with larger numbers, &lt;a href="https://factorcalculator.org" rel="noopener noreferrer"&gt;Factor Calculator&lt;/a&gt; factors any number instantly and makes GCD and LCM practice much faster.&lt;/p&gt;

&lt;p&gt;Learn Euclid's algorithm once, remember the GCD-to-LCM formula, and these problems stop being work and start being fun.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Prime Factorization Made Simple: Breaking Numbers Into Primes</title>
      <dc:creator>Liam Foster</dc:creator>
      <pubDate>Sat, 03 Oct 2026 18:57:58 +0000</pubDate>
      <link>https://dev.to/liamfoster_guides37/prime-factorization-made-simple-breaking-numbers-into-primes-4hek</link>
      <guid>https://dev.to/liamfoster_guides37/prime-factorization-made-simple-breaking-numbers-into-primes-4hek</guid>
      <description>&lt;p&gt;Every whole number is built from smaller building blocks called prime factors. Prime factorization is the process of breaking a number down into the prime numbers that multiply together to make it. For example, 60 = 2 x 2 x 3 x 5. Once you see the pattern, it becomes a satisfying little puzzle.&lt;/p&gt;

&lt;p&gt;Why does this matter? Prime factors are the DNA of a number. They let you simplify fractions quickly, check whether a number is divisible by something, and understand how numbers relate to each other. Cryptography - the math that keeps your passwords and bank details safe - leans on the fact that factoring huge numbers into primes is extremely hard for computers.&lt;/p&gt;

&lt;p&gt;The simplest way to factor a number by hand is the division method. Start with the smallest prime, 2, and divide as long as the result stays whole. Then move to 3, 5, 7, and so on. Take 84: divide by 2 to get 42, by 2 again to get 21, then 21 is not even so try 3 - 21 divided by 3 is 7, and 7 is prime. So 84 = 2 x 2 x 3 x 7.&lt;/p&gt;

&lt;p&gt;A factor tree works the same way visually. Write the number at the top, split it into any two factors, and keep splitting each branch until every branch ends in a prime. Both methods always give the same answer, because of the Fundamental Theorem of Arithmetic: every integer greater than 1 has exactly one prime factorization.&lt;/p&gt;

&lt;p&gt;You only need to test primes up to the square root of the number. If nothing divides it by then, the number itself is prime. This single trick cuts the work dramatically for big numbers.&lt;/p&gt;

&lt;p&gt;Practice makes it quick. Try 120 on paper: 120 = 2 x 60 = 2 x 2 x 30 = 2 x 2 x 2 x 15 = 2 x 2 x 2 x 3 x 5. When you want to check your hand work or factor larger numbers instantly, a free tool like &lt;a href="https://factorcalculator.org" rel="noopener noreferrer"&gt;Factor Calculator&lt;/a&gt; shows the full factorization in seconds.&lt;/p&gt;

&lt;p&gt;Once you are comfortable with prime factors, ideas like greatest common divisors and least common multiples become almost obvious - and your mental math gets noticeably faster.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Finding all factors of n in O(sqrt(n)) with a tiny JS function</title>
      <dc:creator>Liam Foster</dc:creator>
      <pubDate>Sat, 03 Oct 2026 10:12:37 +0000</pubDate>
      <link>https://dev.to/liamfoster_guides37/finding-all-factors-of-n-in-osqrtn-with-a-tiny-js-function-ia9</link>
      <guid>https://dev.to/liamfoster_guides37/finding-all-factors-of-n-in-osqrtn-with-a-tiny-js-function-ia9</guid>
      <description>&lt;p&gt;Quick one for beginners: you never need to test past the square root. Each divisor found below sqrt(n) gives you its pair for free, which is why a simple loop up to Math.sqrt(n) is enough. I built a small reference page around this idea here: &lt;a href="https://factorcalculator.org" rel="noopener noreferrer"&gt;factor calculator&lt;/a&gt;. Handy when you want to sanity-check homework without doing the loop by hand every time.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
