Skip to main content
4 votes
2 answers
129 views

I need to model a system of several boolean expressions in 512 variables. Due to the number of variables, I found the expressions are way too large to handle normally, which is why I need a way to ...
Noemi's user avatar
  • 41
5 votes
2 answers
213 views

I perform a subtraction with an unsigned type, say std::uint8_t. I can understand if the result will be obtained by modular arithmetic or not, by means of a comparison: auto subtract (std::uint8_t x, ...
user2904251's user avatar
-1 votes
1 answer
110 views

I am trying to solve this https://codeforces.com/problemset/problem/2035/D codeforces problem. I understand the logic and implementation, but I guess I am failing a modular arithmetic. Here is my code:...
Parag Patkulkar's user avatar
1 vote
3 answers
100 views

pari is both a library and Computer algebra programming language through Pari/gp. Now my problem is unlike most similar systems, pari/gp doesn’t decompose automatically modular square roots into prime ...
user2284570's user avatar
  • 3,120
-1 votes
1 answer
133 views

Here I am tasked with creating an UnsignedBigInteger class that can handle numbers bigger than a long. Am allowed to use a byte array as the internal representation, uint8_t[]. What I came up with is ...
Giogre's user avatar
  • 1,664
6 votes
1 answer
199 views

If I try to build the following code: fn main () { let my_val: u32 = 42; match my_val % 2 { 0 => println!("We're even now"), 1 => println!("Well, that'...
Olivier Lasne's user avatar
0 votes
0 answers
317 views

I'm working through some challenges on cryptohack.org and am new to modular arithmetic. They describe it in the following terms: Formally, "calculating time" is described by the theory of ...
Austin Wile's user avatar
0 votes
0 answers
101 views

while computing the question a^b mod 1000000007 for large range of inputs. The major flaw is Integer Overflow after avoiding this we may get stuck by some modular operations So My code unable to ...
VIGNESH REDDY's user avatar
1 vote
0 answers
64 views

Let n be an odd number. Suppose we have the sequence s:=n,n+2,n+4,⋯. The goal is to associate this sequence with two other sequences, a and b. I will show how a and b are related to the original ...
DatBoi's user avatar
  • 131
3 votes
3 answers
628 views

How to calculate a**b % m where all the members are integers, and a^b is outside the int range? I.e. to raise a to the power b under modulo m. I.e. an equivalent of this Python code: pow(a, b, m)
Finesse's user avatar
  • 11.1k
0 votes
0 answers
184 views

This comes up when evaluating a rolling hash of a string by subtracting the old weight of a character and adding a new weight for a new character. Python has infinite length digits and is able to ...
Dracula's user avatar
  • 3,120
0 votes
1 answer
109 views

I have an algorithm for prime numbers, coded in python. There I need to calculate exponentiations modulo large numbers. To be more precise: For h and k let n = h* 2^k + 1 and I want to calculate 17^((...
Lereu's user avatar
  • 151
3 votes
1 answer
829 views

I'm trying to implement the mongomery-ladder method for modular exponentiation for RSA (so N=p•q, p,q are primes) in python, as followed in this paper: My code looks like this: x stands for base, k ...
YahavB's user avatar
  • 107
4 votes
1 answer
448 views

I was given a challenge where the solution involves solving a series of linear modular equations in 14 variables. The following is a selection of these equations: 3a + 3b + 3c + 3d + 3e + 3f + 3g + h +...
Josiah Winslow's user avatar
1 vote
1 answer
619 views

I'm taking an algorithms design and analysis class where we focus on the time and space complexity of common algorithms but I'm having a hard time understanding Big O notation/time complexity. For ...
dpreese's user avatar
  • 61

15 30 50 per page
1
2 3 4 5
23