Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 147

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 155

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 163

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 171

Deprecated: Return type of PhpOption\Some::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/phpoption/phpoption/src/PhpOption/Some.php on line 151

Deprecated: Return type of PhpOption\None::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/phpoption/phpoption/src/PhpOption/None.php on line 118
theorem Archives | forthright48 https://forthright48.com/tag/theorem/ learning never ends Tue, 05 Nov 2019 15:42:50 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.8 Sum of Co-prime Numbers of an Integer https://forthright48.com/sum-of-coprime-numbers-of-integer/?utm_source=rss&utm_medium=rss&utm_campaign=sum-of-coprime-numbers-of-integer https://forthright48.com/sum-of-coprime-numbers-of-integer/#comments Fri, 07 Dec 2018 19:54:01 +0000 https://forthright48.com/?p=596 Problem Given a number $N$, find the sum of all numbers less than or equal to $N$ that are co-prime with $N$. In case you forgot, a number $x$ is co-prime with $N$ if $gcd(x,N) = 1$. For example, if $N = 10$, then the following numbers are co-prime with it: $[1, 3, 7, 9]$. …

The post Sum of Co-prime Numbers of an Integer appeared first on forthright48.

]]>
https://forthright48.com/sum-of-coprime-numbers-of-integer/feed/ 7
GCD Sum Function https://forthright48.com/gcd-sum-function/?utm_source=rss&utm_medium=rss&utm_campaign=gcd-sum-function https://forthright48.com/gcd-sum-function/#respond Sun, 25 Nov 2018 17:38:44 +0000 https://forthright48.com/?p=502 Problem Given a positive integer $N$, find the value of $g(N)$, where $$g(n) = gcd(1,n) + gcd(2,n) + gcd(3,n) + \dots + gcd(n,n) = \sum_{i=1}^n gcd(i,n)$$ For example, $$ \begin{align} g(6) & = gcd(1,6) + gcd(2,6) + g(3,6) + gcd(4,6) + gcd(5,6) + gcd(6,6) \\ & = 1 + 2 + 3 + 2 + …

The post GCD Sum Function appeared first on forthright48.

]]>
https://forthright48.com/gcd-sum-function/feed/ 0
Multiplicative Function https://forthright48.com/multiplicative-function/?utm_source=rss&utm_medium=rss&utm_campaign=multiplicative-function https://forthright48.com/multiplicative-function/#respond Sat, 24 Nov 2018 09:56:53 +0000 https://forthright48.com/?p=439 A function $f(n)$ is called multiplicative function if: $f(n)$ is defined for positive integer $n$. $f(1) = 1$ $f(mn) = f(m)f(n)$ whenever $gcd(m,n) = 1$. For example, the following functions are multiplicative: Euler Phi – $\phi(n)$ Number of Divisor – $\sigma_0(n)$ Sum of Divisor – $\sigma_1(n)$ Divisor Sum Theorem of Multiplicative Function Theorem: Let $f(n)$ …

The post Multiplicative Function appeared first on forthright48.

]]>
https://forthright48.com/multiplicative-function/feed/ 0
Lucas Theorem – Proof and Applications https://forthright48.com/lucas-theorem-proof-and-applications/?utm_source=rss&utm_medium=rss&utm_campaign=lucas-theorem-proof-and-applications https://forthright48.com/lucas-theorem-proof-and-applications/#comments Fri, 16 Nov 2018 08:48:24 +0000 https://forthright48.com/?p=352 Problem Given non-negative integers $N$, $K$ and a prime number $P$, find the value of: $$\binom{N}{K} \mod P$$ Sounds like a simple problem right? There are several ways to solve the problem, depending on the constraints of $N$, $K$, and $P$. Direct: If $N$, $K$ are really small, less than $12$, then we can calculate …

The post Lucas Theorem – Proof and Applications appeared first on forthright48.

]]>
https://forthright48.com/lucas-theorem-proof-and-applications/feed/ 1
Stars and Bars Theorem https://forthright48.com/stars-and-bars-theorem/?utm_source=rss&utm_medium=rss&utm_campaign=stars-and-bars-theorem https://forthright48.com/stars-and-bars-theorem/#respond Sun, 23 Sep 2018 15:32:54 +0000 https://forthright48.com/?p=307 Problem Given K variables, $a_1, a_2, a_3 \dots a_K$ and a value $N$, how many ways can we write $a_1 + a_2 + a_3 \dots a_K = N$, where $a_1, a_2, a_3 \dots a_K$ are non-negative integers? For example, if $K = 3$ and $N=2$, there are 6 solutions. a b c ----- 2 0 …

The post Stars and Bars Theorem appeared first on forthright48.

]]>
https://forthright48.com/stars-and-bars-theorem/feed/ 0
Prufer Code: Linear Representation of a Labeled Tree https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/?utm_source=rss&utm_medium=rss&utm_campaign=prufer-code-linear-representation-of-a-labeled-tree https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/#comments Sun, 28 Jan 2018 19:02:00 +0000 I guess this is going to be my first post (apart from the contest analysis’) which is not about Number Theory! It’s not about graph either, even though the title has “Tree” in it. This post is actually about Combinatorics. Prufer code, in my opinion, is one of the most underrated algorithms I have learned. …

The post Prufer Code: Linear Representation of a Labeled Tree appeared first on forthright48.

]]>
https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/feed/ 2
Chinese Remainder Theorem Part 2 – Non Coprime Moduli https://forthright48.com/chinese-remainder-theorem-part-2-non-coprime-moduli/?utm_source=rss&utm_medium=rss&utm_campaign=chinese-remainder-theorem-part-2-non-coprime-moduli https://forthright48.com/chinese-remainder-theorem-part-2-non-coprime-moduli/#respond Sat, 18 Nov 2017 17:39:00 +0000 As promised on the last post, today we are going to discuss the “Strong Form” of Chinese Remainder Theorem, i.e, what do we do when the moduli in the congruence equations are not pairwise coprime. The solution is quite similar to the one we have already discussed in the previous post, so hopefully, it will …

The post Chinese Remainder Theorem Part 2 – Non Coprime Moduli appeared first on forthright48.

]]>
https://forthright48.com/chinese-remainder-theorem-part-2-non-coprime-moduli/feed/ 0
Euler Phi Extension and Divisor Sum Theorem https://forthright48.com/euler-phi-extension-and-divisor-sum/?utm_source=rss&utm_medium=rss&utm_campaign=euler-phi-extension-and-divisor-sum https://forthright48.com/euler-phi-extension-and-divisor-sum/#comments Sat, 26 Sep 2015 08:57:00 +0000 Previously we learned about Euler Phi Function. Today we are going to look at two theorems related to Euler Phi that frequently appears in CPPS. I am not sure whether these theorems have any official names, so I just made them up. These allow easy references so I will be using these names from now …

The post Euler Phi Extension and Divisor Sum Theorem appeared first on forthright48.

]]>
https://forthright48.com/euler-phi-extension-and-divisor-sum/feed/ 2
Euler Totient or Phi Function https://forthright48.com/euler-totient-or-phi-function/?utm_source=rss&utm_medium=rss&utm_campaign=euler-totient-or-phi-function https://forthright48.com/euler-totient-or-phi-function/#comments Fri, 04 Sep 2015 11:38:00 +0000 I have been meaning to write a post on Euler Phi for a while now, but I have been struggling with its proof. I heard it required the Chinese Remainder Theorem, so I have been pushing this until I covered CRT. But recently, I found that CRT is not required and it can be proved …

The post Euler Totient or Phi Function appeared first on forthright48.

]]>
https://forthright48.com/euler-totient-or-phi-function/feed/ 4
Extended Euclidean Algorithm https://forthright48.com/extended-euclidean-algorithm/?utm_source=rss&utm_medium=rss&utm_campaign=extended-euclidean-algorithm https://forthright48.com/extended-euclidean-algorithm/#comments Sun, 26 Jul 2015 08:18:00 +0000 https://forthright48.com/2015/07/26/extended-euclidean-algorithm/ Extended Euclidean Algorithm is an extension of Euclidean Algorithm which finds two things for integer $a$ and $b$: It finds the value of $GCD(a,b)$. It finds two integers $x$ and $y$ such that, $ax + by = gcd(a,b)$. The expression $ax + by = gcd(a,b)$ is known as Bezout’s identity and the pair $(x,y)$ that …

The post Extended Euclidean Algorithm appeared first on forthright48.

]]>
https://forthright48.com/extended-euclidean-algorithm/feed/ 4