Commit 01f88797 by Nayuki

### P211: Updated comments in Java solution.

`Readme: Updated copyright year.`
parent 9e2bcfc8
 ... @@ -13,7 +13,7 @@ Home page with background info, table of solutions, benchmark timings, and more: ... @@ -13,7 +13,7 @@ Home page with background info, table of solutions, benchmark timings, and more: ---- ---- Copyright © 2018 Project Nayuki. All rights reserved. No warranty. Copyright © 2019 Project Nayuki. All rights reserved. No warranty. This code is provided for reference only. You may republish any of this code verbatim with author and URL info intact. This code is provided for reference only. You may republish any of this code verbatim with author and URL info intact. ... ...
 ... @@ -62,11 +62,11 @@ public final class p211 implements EulerSolution { ... @@ -62,11 +62,11 @@ public final class p211 implements EulerSolution { // Consider the set of all squared natural numbers, i.e. {0, 1, 4, 9, 16, 25, ...}. // Consider the set of all squared natural numbers, i.e. {0, 1, 4, 9, 16, 25, ...}. // When this set is viewed modulo some number n, usually not every residue is in the set. // When this set is viewed modulo some number n, usually not every residue is in the set. // For example, all squares modulo 3 is {0, 1} - so a perfect square modulo 3 is never 2. // For example, all squares modulo 3 is {0, 1} - so a perfect square modulo 3 is never 2. // By choosing a suitably large modulus, we can . // By choosing a suitably large modulus, we can quickly exclude many numbers that can't be perfect squares. private static final class SquareTester { private static final class SquareTester { // isResidue[i] is true iff there exists a natural number k such that k^2 = i mod modulus. // isResidue[i] is true iff there exists a natural number k such that i = k^2 mod modulus. // Hence for any k, if isResidue[k] is false then k is not a perfect square. // Hence for any i, if isResidue[i mod modulus] is false, then i is not a perfect square. private boolean[] isResidue; private boolean[] isResidue; ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!