Skip to main content
userviswa's user avatar
userviswa's user avatar
userviswa's user avatar
userviswa
  • Member for 2 years, 6 months
  • Last seen more than 2 years ago
comment
Closed form for sum of modulo remainders
Basically I want to separate $N$ from $N_i$, so that all operations on $N_i$ can be pre-computed, instead of computing the mod every time I get a $N$.
comment
Closed form for sum of modulo remainders
Oh! i understand it now. May be my understanding of closed form is different, may be even wrong. What I searching for is to represent $K$ as a function of $n$, $N$ and some $f(N_i)$. An example would be the sum of natural number 1+2+3+ ... n = n(n+1)/2, a formula where I can avoid running through the numbers to compute the sum. Is something like this possible?
comment
Closed form for sum of modulo remainders
@StevenClark $M \neq \sum_{i=1}^n N_i$, but it is the sum of remainders $M = \sum_{i=1}^n N_i \% N$. Also, $N$ has no relation to $N_i$, so there is no such restriction as $0 < N_i < N$.
comment
Closed form for sum of modulo remainders
@StevenClark I have modified the question to reduce confusions, wrt random. Please let me know if this clarifies your doubts. Distinct implied $N_i \neq N_j$, which is optional, just in case it helped to arrive at a solution quicker. $N$ can be any other number either inside or outside the set of {$N_i$} and $M$ is just the representation of the actual sum.
revised
Closed form for sum of modulo remainders
added 156 characters in body
Loading…
awarded
awarded
revised
Loading…
revised
Closed form for sum of modulo remainders
added definition for $K$
Loading…
comment
Closed form for sum of modulo remainders
@NawafBou-Rabee K is the quotient when M is divided by N
comment
Closed form for sum of modulo remainders
@GerryMyerson Oops that right, it should start from $N_1$ not $N_0$.
asked
Loading…