# Mathematics

## Star and Bars – Combinatorics for CP

Hello guys, welcome back to “code with asharam”. I am back with another mathematics for competitive programming post. In this post, I will discuss star and bars technique to solve a specific set of combinatorics problems. This technique is called ball and urn approach. Problems based on this topic appears quite frequently in competitive programming …

## Prime Factors Algorithm – A beginner’s Guide

Hello guys, welcome back to “code with asharam”. I will continue with my mathematics for competitive programming series in this post. In the last post, I discussed various Prime Numbers algorithms. One of the most important topics related to Prime Numbers is Prime Factors. You can find at least one problem related to prime factors …

## Prime Numbers Algorithms – A beginner’s guide

Hello guys, welcome back to “code with asharam”. I will continue with my mathematics for Competitive Programming Series in this post. Prime Numbers is I guess most frequent topics in competitive programming. Almost in every contest, you can find something related to primality testing, seive of eratosthenes or finding prime factors. Therefore, it becomes very …

## Modular Arithmetic For Competitive Programming

Hello guys, welcome back to “code with asharam”. I will continue with my mathematics series in this post. So, in this post I will discuss one of the most frequent topics in competitive programming – Modular Arithmetic. Finding modulo is really simple but finding inverse modulo is little tricky. That’s why I will tell you …

## GCD For Competitive Programming

Hello guys, welcome back to “code with asharam”. I know you would have got tired of hearing long break excuses every time I write a new post. So, this time I won’t make any excuse for 17 day long break. As you might have noticed until now that I will write about GCD in this …