# Questions tagged [modular-arithmetic]

The tag has no usage guidance.

65 questions
Filter by
Sorted by
Tagged with
78 views

### Converting an expression to modular arithmetic automatically

I have the expression $\frac{1}{15} \left(-(-1)^n-5\times 2^{n+2}+3\times 2^{2 n+1}+15\right)$ which I want to calculate mod m for a very large n. My current method is to ask for this exression in ...
65 views

### Last digits via PowerMod [closed]

Do you have an idea why this produces different results? PowerMod[2003, 2002^2001, 1000] 241 ...
73 views

### Finite fields package doesn't simplify

I'm trying to do arithmetic using the FiniteFields package. Supposing a is a generator of a Galois field (say GF(2^5)) I want to be able to simplify things like a^32 and (a^8)^-1. I don't care about ...
73 views

### Sum of zeros in finite Galois field

In the following code: << FiniteFields` GF[{0}] + GF[{0}] == GF[{0}] GF[{0}] + GF[{0}] + GF[{0}] == GF[{0}] Why does the second line ...
151 views

### Solving an equation for rational modulus 1

I want to solve an system of equations of the form $$\prod_{i=1}^n x_i^{M_{i,k}}=1 \qquad k=1,\ldots,n$$ with complex $x_i$ with constraint $|x_i|=1$ and $M_{i,k}$ integers. This is basically a ...
632 views

### Is there a way to speed up Simplify and/or PolynomialReduce Modulus-> 2?

I'm trying to simplify a series of equations with at most 64 input terms. As the number of terms involved in the equations increase, the runtime seems to grow exponentially. Does anyone know of ways ...
237 views

### Solving for $d$ in $x= E^d \bmod(n)$

With regards to Public Key Cryptography, I have been tasked with the problem of attacking some information given in an assignment and discovered a private key used to digitally sign a message. Known: ...
41 views

### Looping on ranges (Modular iterations)

Is it possible to make the following code modular, so that it works up till depth n, and returns an array of all possible combinations for used{}? ...
44 views

### Get missing cyclic numbers via modulus?

Consider a list of numbers: list = {1,2,3,4,5}; Taking a random set of three of these numbers: ...
58 views

### Putting some calculations together to form an algorithm

Considering these below where n is an odd number, k is also an odd number less than n: <...
87 views

### How can I seperate specific elements from the list? [duplicate]

Possible Duplicate: Question about MapThread and Dynamic I write a function name as inputFieldsList and it returns both ...
79 views

### Variables defined modulo $\pi$ and avoiding singularities; phase plotting for a map

I have the following $2$-dimensional implicitly defined map ...
53 views

### Function to add two matrices mod 2 [duplicate]

I have: lightstep[m_, gg_] := Which[gg == {1, 1}, m = Mod[m + m, 2]] Then I entered: A = {{1, 1, 0}, {1, 0, 0}, {0, 0, 0}} ...
I would like to produce elements (preferably by Table or For-If commands) that they belong to specific sets. For example I want to write positive integers from 1 to 100 such that they are $2 \pmod 3$, ...