Skip to content

Commit 5d270c5

Browse files
diksownadamant-pwn
authored andcommitted
fix typo: mod m -> mod n
1 parent 99c35d7 commit 5d270c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/others/josephus_problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int josephus(int n, int k) {
7777
This formula can also be found analytically.
7878
Again here we assume 0-indexing.
7979
After we delete the first number, we have $n-1$ numbers left.
80-
When we repeat the procedure, we will start with the number that had originally the index $k \bmod m$.
80+
When we repeat the procedure, we will start with the number that had originally the index $k \bmod n$.
8181
$J_{n-1, k}$ would be the answer for the remaining circle, if we start counting at $0$, but because we actually start with $k$ we have $J_{n, k} = (J_{n-1,k} + k) \ \bmod n$.
8282

8383
## Modeling a $O(k \log n)$ solution

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy