https://asone.ai/polymath/api.php?action=feedcontributions&user=Yangofzeal&feedformat=atomPolymath Wiki - User contributions [en]2020-08-15T07:53:05ZUser contributionsMediaWiki 1.23.5https://asone.ai/polymath/index.php?title=Verify_the_bounded_discrepancy_of_an_input_sequenceVerify the bounded discrepancy of an input sequence2010-01-12T01:43:22Z<p>Yangofzeal: </p>
<hr />
<div>[http://michaelnielsen.org/polymath1/index.php?title=Experimental_results back to the main experimental results page].<br />
<br />
<pre><br />
#!/usr/bin/env python<br />
"""Erdos Discrepancy Problem sequence verification.<br />
<br />
Verifies that discrepancy is bounded<br />
for 1124-length sequence of +/-1.<br />
<br />
file 1124_min.txt should contain:<br />
+ - + + - - - - ...<br />
<br />
by Michael Yang, 2010<br />
<br />
"""<br />
from __future__ import with_statement<br />
from numpy import zeros, int8<br />
SEQUENCE_LENGTH = 1124<br />
fileInput = '1124_min.txt'<br />
<br />
class DiscrepancyError(Exception):<br />
pass<br />
<br />
def verifySequence(x, C=2, verbose=False):<br />
"""verify discrepancy <= C<br />
<br />
"""<br />
for i in range(SEQUENCE_LENGTH):<br />
inds = range(i,SEQUENCE_LENGTH,i+1)<br />
s = x[inds].sum() # discrepancy<br />
if abs(s) > C:<br />
msg = 'd = %d has discrepancy %s'<br />
msg %= (i+1, s)<br />
raise DiscrepancyError(msg)<br />
if verbose: print i+1, s<br />
if verbose: print 'verified'<br />
return True<br />
<br />
if __name__=='__main__':<br />
# load +/- sequence<br />
x = zeros(SEQUENCE_LENGTH, dtype = int8)<br />
with open(fileInput, 'r') as f:<br />
a = f.read()<br />
for i, side in enumerate(a.strip().split()):<br />
if side == '-':<br />
x[i] = -1<br />
elif side == '+':<br />
x[i] = 1<br />
assert i == SEQUENCE_LENGTH - 1<br />
isGood = verifySequence(x)<br />
</pre></div>Yangofzealhttps://asone.ai/polymath/index.php?title=Verify_the_bounded_discrepancy_of_an_input_sequenceVerify the bounded discrepancy of an input sequence2010-01-12T01:32:09Z<p>Yangofzeal: added a link back to the original referring page</p>
<hr />
<div>[http://michaelnielsen.org/polymath1/index.php?title=Experimental_results back to the main experimental results page].<br />
<br />
<pre><br />
#!/usr/bin/env python<br />
"""Erdos Discrepancy Problem sequence verification.<br />
<br />
Verifies that discrepancy is bounded<br />
for 1124-length sequence of +/-1.<br />
<br />
file 1124_min.txt should contain:<br />
+ - + + - - - - ...<br />
<br />
by Michael Yang, 2010<br />
<br />
"""<br />
from __future__ import with_statement<br />
from numpy import zeros, int8<br />
SEQUENCE_LENGTH = 1124<br />
fileInput = '1124_min.txt'<br />
<br />
class DiscrepancyError(Exception):<br />
pass<br />
<br />
def verifySequence(x, C=2, verbose=False):<br />
"""verify discrepancy <= MAX_DISCREPASEQUENCE_LENGTHCY<br />
<br />
"""<br />
for i in range(SEQUENCE_LENGTH):<br />
inds = range(i,SEQUENCE_LENGTH,i+1)<br />
s = x[inds].sum() # discrepancy<br />
if abs(s) > C:<br />
msg = 'd = %d has discrepancy %s'<br />
msg %= (i+1, s)<br />
raise DiscrepancyError(msg)<br />
if verbose: print i+1, s<br />
if verbose: print 'verified'<br />
return True<br />
<br />
if __name__=='__main__':<br />
# load +/- sequence<br />
x = zeros(SEQUENCE_LENGTH, dtype = int8)<br />
with open(fileInput, 'r') as f:<br />
a = f.read()<br />
for i, side in enumerate(a.strip().split()):<br />
if side == '-':<br />
x[i] = -1<br />
elif side == '+':<br />
x[i] = 1<br />
assert i == SEQUENCE_LENGTH - 1<br />
isGood = verifySequence(x)<br />
</pre></div>Yangofzealhttps://asone.ai/polymath/index.php?title=Verify_the_bounded_discrepancy_of_an_input_sequenceVerify the bounded discrepancy of an input sequence2010-01-12T01:29:02Z<p>Yangofzeal: Changed variable names to be more in harmony with theory page</p>
<hr />
<div><pre><br />
#!/usr/bin/env python<br />
"""Erdos Discrepancy Problem sequence verification.<br />
<br />
Verifies that discrepancy is bounded<br />
for 1124-length sequence of +/-1.<br />
<br />
file 1124_min.txt should contain:<br />
+ - + + - - - - ...<br />
<br />
by Michael Yang, 2010<br />
<br />
"""<br />
from __future__ import with_statement<br />
from numpy import zeros, int8<br />
SEQUENCE_LENGTH = 1124<br />
fileInput = '1124_min.txt'<br />
<br />
class DiscrepancyError(Exception):<br />
pass<br />
<br />
def verifySequence(x, C=2, verbose=False):<br />
"""verify discrepancy <= MAX_DISCREPASEQUENCE_LENGTHCY<br />
<br />
"""<br />
for i in range(SEQUENCE_LENGTH):<br />
inds = range(i,SEQUENCE_LENGTH,i+1)<br />
s = x[inds].sum() # discrepancy<br />
if abs(s) > C:<br />
msg = 'd = %d has discrepancy %s'<br />
msg %= (i+1, s)<br />
raise DiscrepancyError(msg)<br />
if verbose: print i+1, s<br />
if verbose: print 'verified'<br />
return True<br />
<br />
if __name__=='__main__':<br />
# load +/- sequence<br />
x = zeros(SEQUENCE_LENGTH, dtype = int8)<br />
with open(fileInput, 'r') as f:<br />
a = f.read()<br />
for i, side in enumerate(a.strip().split()):<br />
if side == '-':<br />
x[i] = -1<br />
elif side == '+':<br />
x[i] = 1<br />
assert i == SEQUENCE_LENGTH - 1<br />
isGood = verifySequence(x)<br />
</pre></div>Yangofzealhttps://asone.ai/polymath/index.php?title=Verify_the_bounded_discrepancy_of_an_input_sequenceVerify the bounded discrepancy of an input sequence2010-01-11T19:46:17Z<p>Yangofzeal: New page: <pre> #!/usr/bin/env python """Erdos Discrepancy Problem sequence verification. Verifies that discrepancy is bounded for 1124-length sequence of +/-1. file 1124_min.txt should contain: +...</p>
<hr />
<div><pre><br />
#!/usr/bin/env python<br />
"""Erdos Discrepancy Problem sequence verification.<br />
<br />
Verifies that discrepancy is bounded<br />
for 1124-length sequence of +/-1.<br />
<br />
file 1124_min.txt should contain:<br />
+ - + + - - - - ...<br />
<br />
by Michael Yang, 2010<br />
<br />
"""<br />
from __future__ import with_statement<br />
from numpy import zeros, int8<br />
N = 1124<br />
fileInput = '1124_min.txt'<br />
<br />
class DiscrepancyError(Exception):<br />
pass<br />
<br />
def verifySequence(x, maxDiscrepancy=2, verbose=False):<br />
"""verify discrepancy <= MAX_DISCREPANCY<br />
<br />
"""<br />
for i in range(N):<br />
inds = range(i,N,i+1)<br />
s = x[inds].sum() # discrepancy<br />
if abs(s) > maxDiscrepancy:<br />
msg = 'n = %d has discrepancy %s'<br />
msg %= (i+1, s)<br />
raise DiscrepancyError(msg)<br />
if verbose: print i+1, s<br />
if verbose: print 'verified'<br />
return True<br />
<br />
if __name__=='__main__':<br />
# load +/- sequence<br />
x = zeros(N, dtype = int8)<br />
with open(fileInput, 'r') as f:<br />
a = f.read()<br />
for i, side in enumerate(a.strip().split()):<br />
if side == '-':<br />
x[i] = -1<br />
elif side == '+':<br />
x[i] = 1<br />
assert i == N - 1<br />
isGood = verifySequence(x)<br />
</pre></div>Yangofzealhttps://asone.ai/polymath/index.php?title=Experimental_resultsExperimental results2010-01-11T19:45:41Z<p>Yangofzeal: /* Source code */</p>
<hr />
<div>[[The Erd&#337;s discrepancy problem|To return to the main Polymath5 page, click here]].<br />
<br />
Perhaps we should have two kinds of subpages to this page: Pages about finding examples, and pages about analyzing them?<br />
<br />
== Experimental data==<br />
* [[The first 1124-sequence]] with discrepancy 2. ''Some more description''<br />
* Other [[length 1124 sequences]] with discrepancy 2. ''Some more description''<br />
* Some data about the problem with [[different upper and lower bound]]. Let N(a,b) be the largest N such that there is a sequence <math>x_1,\dots,x_N</math> all of whose HAP-errors are between -a and b, inclusive.<br />
* Sequences taking values in <math>\mathbb{T}</math>:<br />
** [[4th roots of unity]]<br />
** [[6th roots of unity]]<br />
* [http://thomas1111.wordpress.com/2010/01/10/tables-for-a-c10-candidate/ A sequence of length 407] with discrepancy 2 such that <math>x_n=x_{32 n}</math> for every n. [[The HAP-subsequence structure of that sequence]].<br />
* More [[T32-invariant sequences]].<br />
* Long [[multiplicative sequences]].<br />
* Long sequences satisfying [[T2(x) = -x]].<br />
* Long sequences satisfying [[T2(x) = T5(x) = -x]]<br />
* Long sequences satisfying [[T2(x) = -T3(x)]].<br />
* Long sequences satisfying constraints of the form [[T_m(x) = (+/-)T_n(x)]]<br />
<br />
==Source code==<br />
<br />
* [[Convert raw input string into CSV table]]<br />
* [[Create tables in an HTML file from an input sequence]]<br />
* [[Verify the bounded discrepancy of an input sequence]]<br />
<br />
==Wish list==<br />
<!--<br />
* What is the discrepancy of the sequence defined in [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/ this post], <br />
DONE, i think.<br />
--><br />
* Find long/longest quasi-multiplicative sequences with some fixed group G, function <math>G\to \{-1,1\}</math> and maximal discrepancy C<br />
** <math>G=C_6</math> and the function that sends 0,1 and 2 to 1 (because this seems to be a good choice)<br />
* Do a "Mark-Bennet-style analysis" of one of the new 1124-sequences. [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4827] Also [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4842 done] (by Mark Bennet).<br />
*. Take a moderately large k and search for the longest sequence of discrepancy 2 that's constructed as follows. First, pick a completely multiplicative function f to the group <math>C_{2k}</math>. Then set <math>x_n</math> to be 1 if f(n) lies between 0 and k-1, and -1 if f(n) lies between k and 2k-1. Alec has already [http://gowers.wordpress.com/2009/12/17/erdoss-discrepancy-problem/#comment-4563 done this for k=1] and [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4734 partially done it for k=3].<br />
*Search for the longest sequence of discrepancy 2 with the property that <math>x_n=x_{32n}</math> for every n. The motivation for this is to produce a fundamentally different class of examples (different because their group structure would include an element of order 5). It's not clear that it will work, since 32 is a fairly large number. However, if you've chosen <math>x_{32n}</math> then that will have some influence on several other choices, such as <math>x_{4n},x_{8n}</math> and <math>x_{16n}</math>, so maybe it will lead to something interesting. Alec [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4873 has made a start on this] and an [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4874 initial investigation] suggests that the sequence he has found does indeed have some <math>C_{10}</math>-related structure. <br />
*Here's another experiment that should be pretty easy to program and might yield something interesting. It's to look at the how the discrepancy appears to grow when you define a sequence using a greedy algorithm. I say "a" greedy algorithm because there are various algorithms that could reasonably be described as greedy. Here are a few.<br />
<br />
<blockquote><br />
1. For each n let <math>x_n</math> be chosen so as to minimize the discrepancy so far, given the choices already made for <math>x_1,\dots,x_{n-1}</math>. (If this does not uniquely determine <math>x_n</math> then choose it arbitrarily, or randomly, or according to some simple rule like always equalling 1.)<br />
</blockquote><br />
<br />
<blockquote><br />
2. Same as 1 but with additional constraints, in the hope that these make the sequence more likely to be good. For instance, one might insist that <math>x_{2k}=x_{3k}</math> for every k. Here, when choosing <math>x_n</math> one would probably want to minimize the discrepancy up to <math>x_{n+k}</math> if <math>x_{n+1},\dots,x_{n+k}</math> had already been chosen. Another obvious constraint to try is complete multiplicativity.<br />
</blockquote><br />
<br />
<blockquote><br />
3. A greedy algorithm of sorts, but this time trying to minimize a different parameter. The first algorithm will do this: when you pick <math>x_n</math> you look, for each factor d of n, at the partial sum along the multiples of d up to but not including n. This will give you a set A of numbers (the possible partial sums). If max(A) is greater than max(-A) then you set <math>x_n=-1</math>, if max(-A) is greater than max(A) then you let <math>x_n=1</math>, and if they are equal then you make the decision according to some rule that seems sensible. But it might be that you would end up with a slower-growing discrepancy if you regarded A as a multiset and made the decision on some other basis. For instance, you could take the sum of <math>2^k</math> over all positive elements <math>k\in A</math> (with multiplicity) and the sum of <math>2^{-k}</math> over all negative elements and choose <math>x_n</math> according to which was bigger. Although that wouldn't minimize the discrepancy at each stage, it might make the sequence better for future development because it wouldn't sacrifice the needs of an overwhelming majority to those of a few rogue elements.<br />
<br />
The motivation for these experiments is to see whether they, or some variants, appear to lead to sublogarithmic growth. If they do, then we could start trying to prove rigorously that sublogarithmic growth is possible. I still think that a function that arises in nature and satisfies f(1124)=2 ought to be sublogarithmic.<br />
</blockquote><br />
<br />
*What happens if one applies a backtracking algorithm to try to extend the following discrepancy-2 sequence, which satisfies <math>x_{2n}=-x_n</math> for every n, to a much longer discrepancy-2 sequence: + - - + - + + - - + + - + - + + - + - - + - - + + - - + + - + - - + - - + + + + - - - + + + - - + - + + - + - - + - ? This question has been answered [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4893 in the comments following the asking of the question on the blog]. <br />
<br />
* Investigate what happens if our HAPs are restricted to allow differences divisible only by 2 or 3 [and then other sets of primes including 2] - {2,3,5,7} would be interesting - is there an infinite sequence of discrepancy 2 in these simple cases - is it easy to find an infinite sequence with finite discrepancy in these cases? [for sets of odd primes, take a sequence which is 1 on odd numbers, -1 on even numbers. Including 2 is the non-trivial case]. It is possible that completely multiplicative sequences could be found for some of these cases.<br />
<br />
* ... you are welcome to add more.</div>Yangofzealhttps://asone.ai/polymath/index.php?title=Verify_the_bounded_discrepancy_of_sequenceVerify the bounded discrepancy of sequence2010-01-11T19:44:59Z<p>Yangofzeal: New page: <pre> #!/usr/bin/env python """Erdos Discrepancy Problem sequence verification. Verifies that discrepancy is bounded for 1124-length sequence of +/-1. file 1124_min.txt should contain: +...</p>
<hr />
<div><pre><br />
#!/usr/bin/env python<br />
"""Erdos Discrepancy Problem sequence verification.<br />
<br />
Verifies that discrepancy is bounded<br />
for 1124-length sequence of +/-1.<br />
<br />
file 1124_min.txt should contain:<br />
+ - + + - - - - ...<br />
<br />
by Michael Yang, 2010<br />
<br />
"""<br />
from __future__ import with_statement<br />
from numpy import zeros, int8<br />
N = 1124<br />
fileInput = '1124_min.txt'<br />
<br />
class DiscrepancyError(Exception):<br />
pass<br />
<br />
def verifySequence(x, maxDiscrepancy=2, verbose=False):<br />
"""verify discrepancy <= MAX_DISCREPANCY<br />
<br />
"""<br />
for i in range(N):<br />
inds = range(i,N,i+1)<br />
s = x[inds].sum() # discrepancy<br />
if abs(s) > maxDiscrepancy:<br />
msg = 'n = %d has discrepancy %s'<br />
msg %= (i+1, s)<br />
raise DiscrepancyError(msg)<br />
if verbose: print i+1, s<br />
if verbose: print 'verified'<br />
return True<br />
<br />
if __name__=='__main__':<br />
# load +/- sequence<br />
x = zeros(N, dtype = int8)<br />
with open(fileInput, 'r') as f:<br />
a = f.read()<br />
for i, side in enumerate(a.strip().split()):<br />
if side == '-':<br />
x[i] = -1<br />
elif side == '+':<br />
x[i] = 1<br />
assert i == N - 1<br />
isGood = verifySequence(x)<br />
</pre></div>Yangofzealhttps://asone.ai/polymath/index.php?title=Experimental_resultsExperimental results2010-01-11T19:43:14Z<p>Yangofzeal: /* Source code */</p>
<hr />
<div>[[The Erd&#337;s discrepancy problem|To return to the main Polymath5 page, click here]].<br />
<br />
Perhaps we should have two kinds of subpages to this page: Pages about finding examples, and pages about analyzing them?<br />
<br />
== Experimental data==<br />
* [[The first 1124-sequence]] with discrepancy 2. ''Some more description''<br />
* Other [[length 1124 sequences]] with discrepancy 2. ''Some more description''<br />
* Some data about the problem with [[different upper and lower bound]]. Let N(a,b) be the largest N such that there is a sequence <math>x_1,\dots,x_N</math> all of whose HAP-errors are between -a and b, inclusive.<br />
* Sequences taking values in <math>\mathbb{T}</math>:<br />
** [[4th roots of unity]]<br />
** [[6th roots of unity]]<br />
* [http://thomas1111.wordpress.com/2010/01/10/tables-for-a-c10-candidate/ A sequence of length 407] with discrepancy 2 such that <math>x_n=x_{32 n}</math> for every n. [[The HAP-subsequence structure of that sequence]].<br />
* More [[T32-invariant sequences]].<br />
* Long [[multiplicative sequences]].<br />
* Long sequences satisfying [[T2(x) = -x]].<br />
* Long sequences satisfying [[T2(x) = T5(x) = -x]]<br />
* Long sequences satisfying [[T2(x) = -T3(x)]].<br />
* Long sequences satisfying constraints of the form [[T_m(x) = (+/-)T_n(x)]]<br />
<br />
==Source code==<br />
<br />
* [[Convert raw input string into CSV table]]<br />
* [[Create tables in an HTML file from an input sequence]]<br />
* [[Verify the bounded discrepancy of sequence]]<br />
<br />
==Wish list==<br />
<!--<br />
* What is the discrepancy of the sequence defined in [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/ this post], <br />
DONE, i think.<br />
--><br />
* Find long/longest quasi-multiplicative sequences with some fixed group G, function <math>G\to \{-1,1\}</math> and maximal discrepancy C<br />
** <math>G=C_6</math> and the function that sends 0,1 and 2 to 1 (because this seems to be a good choice)<br />
* Do a "Mark-Bennet-style analysis" of one of the new 1124-sequences. [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4827] Also [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4842 done] (by Mark Bennet).<br />
*. Take a moderately large k and search for the longest sequence of discrepancy 2 that's constructed as follows. First, pick a completely multiplicative function f to the group <math>C_{2k}</math>. Then set <math>x_n</math> to be 1 if f(n) lies between 0 and k-1, and -1 if f(n) lies between k and 2k-1. Alec has already [http://gowers.wordpress.com/2009/12/17/erdoss-discrepancy-problem/#comment-4563 done this for k=1] and [http://gowers.wordpress.com/2010/01/06/erdss-discrepancy-problem-as-a-forthcoming-polymath-project/#comment-4734 partially done it for k=3].<br />
*Search for the longest sequence of discrepancy 2 with the property that <math>x_n=x_{32n}</math> for every n. The motivation for this is to produce a fundamentally different class of examples (different because their group structure would include an element of order 5). It's not clear that it will work, since 32 is a fairly large number. However, if you've chosen <math>x_{32n}</math> then that will have some influence on several other choices, such as <math>x_{4n},x_{8n}</math> and <math>x_{16n}</math>, so maybe it will lead to something interesting. Alec [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4873 has made a start on this] and an [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4874 initial investigation] suggests that the sequence he has found does indeed have some <math>C_{10}</math>-related structure. <br />
*Here's another experiment that should be pretty easy to program and might yield something interesting. It's to look at the how the discrepancy appears to grow when you define a sequence using a greedy algorithm. I say "a" greedy algorithm because there are various algorithms that could reasonably be described as greedy. Here are a few.<br />
<br />
<blockquote><br />
1. For each n let <math>x_n</math> be chosen so as to minimize the discrepancy so far, given the choices already made for <math>x_1,\dots,x_{n-1}</math>. (If this does not uniquely determine <math>x_n</math> then choose it arbitrarily, or randomly, or according to some simple rule like always equalling 1.)<br />
</blockquote><br />
<br />
<blockquote><br />
2. Same as 1 but with additional constraints, in the hope that these make the sequence more likely to be good. For instance, one might insist that <math>x_{2k}=x_{3k}</math> for every k. Here, when choosing <math>x_n</math> one would probably want to minimize the discrepancy up to <math>x_{n+k}</math> if <math>x_{n+1},\dots,x_{n+k}</math> had already been chosen. Another obvious constraint to try is complete multiplicativity.<br />
</blockquote><br />
<br />
<blockquote><br />
3. A greedy algorithm of sorts, but this time trying to minimize a different parameter. The first algorithm will do this: when you pick <math>x_n</math> you look, for each factor d of n, at the partial sum along the multiples of d up to but not including n. This will give you a set A of numbers (the possible partial sums). If max(A) is greater than max(-A) then you set <math>x_n=-1</math>, if max(-A) is greater than max(A) then you let <math>x_n=1</math>, and if they are equal then you make the decision according to some rule that seems sensible. But it might be that you would end up with a slower-growing discrepancy if you regarded A as a multiset and made the decision on some other basis. For instance, you could take the sum of <math>2^k</math> over all positive elements <math>k\in A</math> (with multiplicity) and the sum of <math>2^{-k}</math> over all negative elements and choose <math>x_n</math> according to which was bigger. Although that wouldn't minimize the discrepancy at each stage, it might make the sequence better for future development because it wouldn't sacrifice the needs of an overwhelming majority to those of a few rogue elements.<br />
<br />
The motivation for these experiments is to see whether they, or some variants, appear to lead to sublogarithmic growth. If they do, then we could start trying to prove rigorously that sublogarithmic growth is possible. I still think that a function that arises in nature and satisfies f(1124)=2 ought to be sublogarithmic.<br />
</blockquote><br />
<br />
*What happens if one applies a backtracking algorithm to try to extend the following discrepancy-2 sequence, which satisfies <math>x_{2n}=-x_n</math> for every n, to a much longer discrepancy-2 sequence: + - - + - + + - - + + - + - + + - + - - + - - + + - - + + - + - - + - - + + + + - - - + + + - - + - + + - + - - + - ? This question has been answered [http://gowers.wordpress.com/2010/01/09/erds-discrepancy-problem-continued/#comment-4893 in the comments following the asking of the question on the blog]. <br />
<br />
* Investigate what happens if our HAPs are restricted to allow differences divisible only by 2 or 3 [and then other sets of primes including 2] - {2,3,5,7} would be interesting - is there an infinite sequence of discrepancy 2 in these simple cases - is it easy to find an infinite sequence with finite discrepancy in these cases? [for sets of odd primes, take a sequence which is 1 on odd numbers, -1 on even numbers. Including 2 is the non-trivial case]. It is possible that completely multiplicative sequences could be found for some of these cases.<br />
<br />
* ... you are welcome to add more.</div>Yangofzeal