Modular arithmetic (clock arithmetic) is a system of integer arithmetic based on the congruence relation $a \equiv b \pmod{n}$ which means that $n$ divides $b-a$.

learn more… | top users | synonyms

2
votes
0answers
30 views

How do I interpret “K2 mod K1”?

I've been doing a bit of work these past couple of nights on computing cyclic subspace decompositions, finding cyclic bases, and then computing the Jordan canonical form of matrices. My question is: ...
1
vote
1answer
23 views

In a modular arithmetic equation, how to find 'a' given a range?

Say I have an equation in the form $$a\bmod b = c$$ I know $b$ and $c$ I'm given a range $(d,e)$ (where $d$ and $e$ are integers). How can I find all values of $a$ that satisfy the inequality $d ...
1
vote
0answers
13 views

A stochastic variant of the heat equation modulo $2\pi$ has weird unstable particle-antiparticle solutions. Does this equation have a name?

I implemented a discretization of a weird 2D heat equation "mod $2\pi$", $$\dot{f}(\mathbf{x},t)=\Delta^*f(\mathbf{x},t)$$ where (WARNING: handwavy, I'm not sure I understand it) ...
-4
votes
1answer
40 views

A system with modular arithmetic [on hold]

How do I solve this system? Note: (y mod 10) = (x mod 10). $$\begin{cases} 2y - x + (x \bmod 10) = 42\\[1ex] y + (x \bmod 10)= 32 \end{cases}$$ for x and y?
1
vote
1answer
41 views

How many solutions for $(6b)^b\equiv (12b-k)^b\mod p$?

Rephrasing my previous question; If $(6b)^b\equiv (12b-k)^b\mod p$, where $b$ is odd and $p=1+6qb$, and where $p$ and $q$ are prime, are there any solutions for $k$ other than $k\equiv6b\mod p$?
0
votes
1answer
25 views

Proving B Congruent C given AB congruent AC

This is a very trivial question, i seem to have arrived at a proof for an excercise but the proof just doesn't feel.. right. It is too small and simple. The fact to be proved is that if $AB\equiv AC$ ...
2
votes
4answers
83 views

If $a^b\equiv c^b\mod p$, can we conclude that $a\equiv c\mod p$?

If $a^b\equiv c^b\mod p$, is is true that $a\equiv c\mod p$, where $b$ is odd and $p$ is prime? We know that if $a\equiv c\mod p$, then $a^b\equiv c^b\mod p$. Is the reverse true?
1
vote
2answers
65 views

Prove that there are infinitely many composite numbers of the form $2^{2^n}+3$.

There are infinitely many composite numbers of the form $2^{2^n}+3$. [Hint: Use the fact that $2^{2n}=3k+1$ for some $k$ to establish that $7\mid2^{2^{2n+1}}+3$.] If $p$ is a prime divisor of ...
0
votes
2answers
20 views

Modular arithmetic exponentiation

Does modulus apply to exponents as well. eg Let $ xy \equiv 1 (mod\;m).$ then does $a^{xy} \equiv a^{1} (mod\;m)$ ?
0
votes
0answers
27 views

Exponential cryptosystem

The cryptosystem works as follows: The plaintext message is first replaced by ciphers (a=00, b=01, etc.) and then encrypted in blocks of four digits. So if the message is "hi", the plaintext number ...
0
votes
4answers
34 views

How can I calculate these large exponents with mods?

Is there a fast technique that I can use that is similar in each case to calculate the following: $$(1100)^{1357} \mod{2623} = 1519$$ $$(1819)^{1357} \mod{2623} = 2124$$ $$(0200)^{1357} \mod{2623} ...
3
votes
1answer
38 views

Finding period of a recursive sequence defined by modular operator?

If $f(x)$ is defined as : $f(x)=i$ ,if $x\equiv i$ (mod n), $0\leq i< n$ How can I prove whether the following recursive sequences are periodic or not? ...
2
votes
2answers
78 views

From a silly (long division) puzzle comes an interesting number-theory “theorem” (quotes indicate some doubt).

I've worked a BUNCH of this type of long division puzzle. EDIT (The problem represents LOELPE/MNTN where EP is the quotient and LEAC is the remainder, with LIONP representing E times MNTN, PPMC ...
1
vote
2answers
62 views

Modulus and Fermat's Little Theorem

How do I calculate $ 11^{23} \bmod{163} $ using fermat's little theorem ?
1
vote
1answer
60 views

Solve $n(n+1) \equiv 0 \pmod{1004}$

Solve: $$n(n+1) \equiv 0 \pmod{1004}$$ For the smallest possible $n > 0$. It's either $n \equiv 0$ or $n \equiv -1 \pmod{1004}$. The correct answer is $251$, I'm not sure how though.
3
votes
1answer
54 views

Does $(a^p + b^p)^{p-1} \equiv 1 \pmod {p^2}$ have any solutions where $a$ and $b$ are co-primes less than $p$?

How will you prove that $(a^p + b^p)^{p-1} \equiv 1 \pmod {p^2}$ has no solution where $p$ is a prime number and $a$, $b$ are two co-primes less than $p$? If this equation has a solution, then what it ...
25
votes
1answer
281 views

Fibonacci $\equiv -1 \mod p^2$

Is there a prime $p > 3$ such that the Fibonacci number $F_{np} \equiv -1 \mod p^2$ for some natural number $n$? I know none of the first $1000$ primes $> 3$ qualify. EDIT: In response to ...
0
votes
1answer
58 views

Calculate $2^n \pmod{14^8}$ with large numbers quickly

Is there a way to calculate $2^n \pmod{14^8}$ faster than binary exponentiation? The $n$ values in question are very large, for example $2^{65536}$, and the calculations have to be done around $14^8$ ...
2
votes
2answers
44 views

Wilson's theorem

According to Wilson's theorem, when p is prime (p-1)! mod p = -1 or p-1 What's the remainder in cases of (p-2)! mod p or ...
1
vote
5answers
72 views

Mod question: $-5 \pmod 3$?

How come $-5 \equiv 1 \pmod 3$ and not $-5 \equiv 2\ $ or $\ -2 \pmod{3}$? $-\frac{5}{3}= -1 -\frac{2}{3}$. i.e. Remainder is $-2$ or $2$?
3
votes
4answers
2k views

Calculate 2000! (mod 2003)

Calculate 2000! (mod 2003) This can easily be solved by programming but is there a way to solve it, possibly with knowledge about finite fields? (2003 is a prime number, so mod(2003) is a finite ...
2
votes
3answers
56 views

Problem in proof of Chinese remainder theorem, and applying it.

Please don't mark it as duplicate. First read the whole question. So Chinese Remainder Theorem states that,: Let $n_1,n_2,...,n_k$ be $k$ positive integers which are pairwise relatively prime. If ...
0
votes
1answer
23 views

Multiplicative inverse of polynomial modulus an integer

How do you calculate the multiplicative inverse of a polynomial mod a monomial/integer?The specific questions are: Find the multiplicative inverse of 1) x+1 mod 3 2) x^2+x-1 mod 3 3) x^2+x-1 mod 32 I ...
1
vote
1answer
35 views

Cycles in the Fibonacci Sequence mod n with matrices

I was just looking at this question about Fibonacci sequence cycles modulo 5, and I happened to see a very nice solution that involved using matrices. Using the matrix representation of the Fibonacci ...
2
votes
1answer
38 views

Closed-Form Modular Arithmetic

Is there a way to define modulo division (or functions of modular arithmetic in general) as superposition of (elementary?) functions? For example, the multiplication is first introduced as ...
37
votes
13answers
5k views

How to prove that the Fibonacci sequence is periodic mod 5 without using induction?

The sequence $(F_{n})$ of Fibonacci numbers is defined by the recurrence relation $$F_{n}=F_{n-1}+F_{n-2}$$ for all $n \geq 2$ with $F_{0} := 0$ and $F_{1} :=1$. Without mathematical induction, ...
3
votes
1answer
26 views

Modular arithmetic: $P \cdot Q^{-1} \mod p$

I am reading an explanation to a programming competition, where one of the step is to calculate $P \cdot Q^{-1} \mod p$, where p is a prime. I was always doing this by calculating multiplicative ...
1
vote
1answer
24 views

Rules for modulo of bitwise xor

There are rules for modulo operation involving summation, multiplication and division. For example: ...
1
vote
0answers
35 views

Modular fractions: $5 \big| 3- \frac 12$

I've read a lot here about how modular fractions are valid as long as the denominator is invertible, but they always cause me trouble understing this part: From the definition of congruence: $$ a ...
2
votes
2answers
70 views

How can I simplify $123^{11} \mod 323$?

I am busy studying the RSA cryptosystem and would like to know how to simplify things like this: $123^{11} \mod 323$
2
votes
1answer
31 views

Congruence of 2 fractions—how to properly rewrite in terms without modulo?

EDIT: Following Theo's comment, the equivalence holds since one can (must) rewrite $1/a$ as $(1+23k)/a$. Provided that $$\frac{1}{25} \equiv \frac{1}{2}\pmod {23}$$ is true, why can I not rewrite ...
1
vote
0answers
33 views

What are modulos and how would I be able to use them to solve questions regarding the last digit of a raised power?

When given questions like "What is the last digit of the result to 3^56?", I usually look for a recurring pattern involving smaller powers of 3. In this question for example, the recurring pattern for ...
1
vote
1answer
23 views

$a\cdot(b^{-1}\bmod m)$ Can be be solved using modular multiplication

Does $a\cdot(b^{-1}\bmod m) = (a\bmod m) \cdot(b^{-1}\bmod m).$ where $\bmod$ represents remainder left on division with $m$. $b^{-1} \bmod m$ is multiplicative inverse.
6
votes
4answers
604 views

Last 10 digits of the billionth fibonacci number?

I want to compute the last ten digits of the billionth fibonacci number, but my notebook doesn't even have the power to calculate such big numbers, so I though of a very simple trick: The carry of ...
0
votes
2answers
33 views

If $g$ is a primitive root modulo $p$, then $(p-1)! \equiv g^{p(p-1)/2} \pmod{p}$

Does anyone know how to prove the following theorem: If $g$ is a primitive root modulo $p$ (and $p$ is a prime number), then $$(p-1)! \equiv g^{p(p-1)/2} \pmod{p}.$$
0
votes
1answer
31 views

The solutions to $x^m \equiv 1 \bmod p$ will all be solutions to $x^{mn} \equiv 1 \bmod p$ for any $n$.

Can you please show the proof of "The solutions to $x^m \equiv 1 \bmod p$ will all be solutions to $x^{mn} \equiv 1 \bmod p$ for any $n$."
0
votes
0answers
25 views

subsets with predefined sequences

I have a set $N=\{m,m+1,m+2,...,n\}$ And there are some generating functions of the format : $f(x,k) = (x^2 -1) \mod k$, where $k \le \sqrt m$ and $k$ is in the form $(6i+1)$ or $(6i-1)$, $\forall ...
0
votes
0answers
31 views

Rabin's cryptography - when the message $M$ isn't coprime to $n = pq$

Say the message $M$ is a product of one of the primes $p$ or $q$, won't the $gcd$ of $M$ and $n$ (the public encryption key) give me $p$ or $q$? say $p = 11$ $q=19$ $n=11*19=209$ and $M=33$. ...
2
votes
2answers
207 views

Fermat's little theorem

This is a very interesting word problem that I came across in an old textbook of mine. So I mused over this problem for a while and tried to look at the different ways to approach it but unfortunately ...
0
votes
1answer
29 views

polynomial modulo for higher degree

Given $f(x) , n, g(x)$ where $g(x)$ is usually of a small degree then if we find $h_1(x)$ such that $f(x)\equiv h_1(x)\mod \{n,g(x)\}$ , Is there any algorithm to find $h_2(x)$ such that $f(x)\equiv ...
2
votes
4answers
126 views

An easy way to calculate $12^{101} \bmod 551$?

We learn about encryption methods, and in one of the exercises we need to calculate: $12^{101} \bmod 551$. There an easy way to calculate it? We know that: $M^5=12 \mod 551$ And $M^{505}=M$ ($M\in ...
0
votes
4answers
97 views

What is the function “mod”

Surfing this site, I have often seen many functions and expressions involving $\bmod$ and I have no clue about its meaning. What does that $\bmod$ mean?
0
votes
4answers
37 views

Units digit when there is a power of power

How do you find the units digit in case of an expression like this $$ 7^{8^7} $$ I know how to find the units digit when there is one integer and there is only one power. But how do I find it when ...
0
votes
4answers
41 views

How to manually determine big number congruences

How is it possible to determine if the the following congruence is true manually, with resort to a basic calculator? The real problem here is how to do the math with a such big number? $$ 2015^{50} ...
4
votes
1answer
85 views

Find the remainder when the sum is divided by $1000$

Find $S \pmod{1000}$ given: $$S = \sum_{n=0}^{2015} n! + n^3 - n^2 + n - 1$$ $$S_0 = 0! + 0 - 0 + 0 -1 = 0$$ $$S_1 = 1! + 1 - 1 + 1 - 1 = 1$$ $$S_2 = 2! + 8 - 4 + 2 - 1 = 7$$ This isn't ...
1
vote
1answer
37 views

Polynomial function residues

If we use Euclid's representation for integers $n=aq+r$, we can write $n\equiv r \mod q$. We can also write functions similarly, for example $n(x)=a(x)q(x)+r(x)$ and so I imagine we can write ...
0
votes
0answers
19 views

One dimensional representations of $SL_2(\mathbb{Z}/n\mathbb{Z})$

Someone knows a reference or knows how to calculate the linear character of $SL_2(\mathbb{Z}/n\mathbb{Z})$, for an arbitrary $n$? Thanks
1
vote
4answers
34 views

system of modular equations.

$x\equiv 2\pmod3$ $x\equiv 3\pmod 5$ $x\equiv 7 \pmod{11}$ How can I solve this system for $x$? I've tried all kinds of things using divisibility but no success. Any hints of solutions are greatly ...
1
vote
3answers
39 views

Smallest divisible repunits

A repunit of length k is a number containing k ones (1, 11, 111...). R(k) is defined to be the repunit of length k. A(n) is the least value of k such that R(k) is divisble by n (assuming gcd(n, 10) ...
6
votes
7answers
203 views

Calculating remainder of $666^{666}$ when divided by $1000$.

I want to calculate the remainder of $666^{666}$ when divided by $1000$. But for the usual methods I use the divisor is very big. Furthermore $1000$ is not a prime, $666$ is a zero divisor in ...