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
Number Theory Archives | forthright48 https://forthright48.com/category/cpps/number-theory/ 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
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
Chinese Remainder Theorem Part 1 – Coprime Moduli https://forthright48.com/chinese-remainder-theorem-part-1-coprime-moduli/?utm_source=rss&utm_medium=rss&utm_campaign=chinese-remainder-theorem-part-1-coprime-moduli https://forthright48.com/chinese-remainder-theorem-part-1-coprime-moduli/#comments Wed, 15 Nov 2017 13:17:00 +0000 Second part of the series can be found on: Chinese Remainder Theorem Part 2 – Non Coprime Moduli Wow. It has been two years since I published my last post. Time sure flies by quickly. I have been thinking about resuming writing again for a while now. Took me long enough to get back into …

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

]]>
https://forthright48.com/chinese-remainder-theorem-part-1-coprime-moduli/feed/ 4
Modular Inverse from 1 to N https://forthright48.com/modular-inverse-from-1-to-n/?utm_source=rss&utm_medium=rss&utm_campaign=modular-inverse-from-1-to-n https://forthright48.com/modular-inverse-from-1-to-n/#comments Tue, 29 Sep 2015 16:20:00 +0000 We already learned how to find Modular Inverse for a particular number in a previous post, “Modular Multiplicative Inverse“. Today we will look into finding Modular Inverse in a bulk. Problem Given $N$ and $M$ ( $N < M$ and $M$ is prime ), find modular inverse of all numbers between $1$ to $N$ with …

The post Modular Inverse from 1 to N appeared first on forthright48.

]]>
https://forthright48.com/modular-inverse-from-1-to-n/feed/ 5
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
Modular Multiplicative Inverse https://forthright48.com/modular-multiplicative-inverse/?utm_source=rss&utm_medium=rss&utm_campaign=modular-multiplicative-inverse https://forthright48.com/modular-multiplicative-inverse/#respond Wed, 23 Sep 2015 11:39:00 +0000 Problem Given value of $A$ and $M$, find the value of $X$ such that $AX \equiv 1 \ \text{(mod M)}$. For example, if $A = 2$ and $M = 3$, then $X = 2$, since $2 \times 2 = 4 \equiv 1 \ \text{(mod 3)}$. We can rewrite the above equation to this: $AX \equiv …

The post Modular Multiplicative Inverse appeared first on forthright48.

]]>
https://forthright48.com/modular-multiplicative-inverse/feed/ 0
Repeated Squaring Method for Modular Exponentiation https://forthright48.com/repeated-squaring-method-for-modular-exponentiation/?utm_source=rss&utm_medium=rss&utm_campaign=repeated-squaring-method-for-modular-exponentiation https://forthright48.com/repeated-squaring-method-for-modular-exponentiation/#respond Mon, 21 Sep 2015 09:10:00 +0000 Previously on Modular Exponentiation we learned about Divide and Conquer approach to finding the value of $B^P \ \% \ M$. In that article, which is recursive. I also mentioned about an iterative algorithm that finds the same value in same complexity, only faster due to the absence of recursion overhead. We will be looking …

The post Repeated Squaring Method for Modular Exponentiation appeared first on forthright48.

]]>
https://forthright48.com/repeated-squaring-method-for-modular-exponentiation/feed/ 0
Euler’s Theorem and Fermat’s Little Theorem https://forthright48.com/eulers-theorem-and-fermats-little-theorem/?utm_source=rss&utm_medium=rss&utm_campaign=eulers-theorem-and-fermats-little-theorem https://forthright48.com/eulers-theorem-and-fermats-little-theorem/#respond Thu, 17 Sep 2015 06:59:00 +0000 We will be looking into two theorems at the same time today, Fermat’s Little Theorem and Euler’s Theorem. Euler’s Theorem is just a generalized version of Fermat’s Little Theorem, so they are quite similar to each other. We will focus on Euler’s Theorem and its proof. Later we will use Euler’s Theorem to prove Fermat’s …

The post Euler’s Theorem and Fermat’s Little Theorem appeared first on forthright48.

]]>
https://forthright48.com/eulers-theorem-and-fermats-little-theorem/feed/ 0