From 01f88797904424f823119610346249eaf95efc2f Mon Sep 17 00:00:00 2001
From: Project Nayuki
Date: Fri, 23 Aug 2019 05:20:33 +0000
Subject: [PATCH] P211: Updated comments in Java solution. Readme: Updated
copyright year.
---
Readme.markdown | 2 +-
java/p211.java | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Readme.markdown b/Readme.markdown
index 085d113..d3b8602 100644
--- a/Readme.markdown
+++ b/Readme.markdown
@@ -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.
diff --git a/java/p211.java b/java/p211.java
index 3903bb3..92d9f6b 100644
--- a/java/p211.java
+++ b/java/p211.java
@@ -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, ...}.
// 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.
- // 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 {
- // isResidue[i] is true iff there exists a natural number k such that k^2 = i mod modulus.
- // Hence for any k, if isResidue[k] is false then k is not a perfect square.
+ // isResidue[i] is true iff there exists a natural number k such that i = k^2 mod modulus.
+ // Hence for any i, if isResidue[i mod modulus] is false, then i is not a perfect square.
private boolean[] isResidue;
--
GitLab