Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
2 answers
123 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 ...
5 votes
2 answers
211 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, ...
-1 votes
1 answer
88 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:...
1 vote
3 answers
86 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 ...
-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 ...
6 votes
1 answer
189 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'...
0 votes
0 answers
314 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 ...
0 votes
0 answers
93 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 ...
1 vote
0 answers
63 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 ...
3 votes
3 answers
608 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
  • 11k
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 ...
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
817 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 ...
4 votes
1 answer
421 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 +...
1 vote
1 answer
604 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 ...

15 30 50 per page
1
2 3 4 5
...
23

AltStyle によって変換されたページ (->オリジナル) /