a construction of arithmetic progression-free sequences …
TRANSCRIPT
A CONSTRUCTION OF ARITHMETIC
PROGRESSION-FREE SEQUENCES
by
BRIAN L. MILLER, B.S.
A THESIS
IN
MATHEMATICS
Submitted to the Graduate Faculty of Texas Tech University in
Partial Fulfillment of the Requirements for
the Degree of
MASTER OF SCIENCE
Approved
December, 2004
ACKNOWLEDGMENTS
I first and foremost want to thank Dr. Chris Monico for his patience and dedication
to this work. I also want to thank my undergraduate professors, Dr. Hagler, Dr.
Waugh, and Dr. Hodge for their time, effort, and challenges to become a better
mathematician.
I also want to thank my family, especially my mom and dad, for their support and
encouragement. And to all my friends, Robert, Tanya, and family, the Paz family,
and Jake, thanks for remaining behind me during all of this.
51 xony noGjiaroAapnxb CTacio CnnnKC. H Taic^e xony no6.JiaroAapHTb Mnxaiuia
Xape;i,H sa ero nocBHni,eHHe H no n epxcKy MoeMy o6pa30BaHHio BO Bcex OTHomenHax.
11
CONTENTS
ACKNOWLEDGMENTS ii
ABSTRACT iv
I INTRODUCTION 1
II ATTACK OF THE PROBLEM BACKGROUND 2
2.1 Introduction 2
2.2 Known Results 2
2.3 Span and Its Impact 3
2.3.1 Definitions and Motivations 3
2.3.2 Extension of Values 4
2.3.3 Partitions and Compositions 5
III DESCRIPTION OF THE CONSTRUCTION 13
3.1 Introduction 13
3.2 The Formal Description of the Construction 13
3.3 Justification of the Construction 15
IV CONSEQUENCES OF THE CONSTRUCTION 17
V ANALYSIS OF THE CONSTRUCTION 22
APPENDIX 32
i l l
ABSTRACT
We describe a particular greedy construction of an arithmetic progression-free
sequence from a finite composition. We also give an analysis on the properties of the
resulting sequence.
IV
CHAPTER I
INTRODUCTION
One of the many open problems that remains in number theory addresses the
question of existence of arbitrarily long finite arithmetic progressions of primes. Erdos
asked a more general question: If A is an infinite set of positive integers such that
the series Y^^eA ^~^ diverges, then must A contain arbitrarily long finite arithmetic
progressions? If the answer to his question is yes, then this would definitely imply
the existence of arbitrarily long finite arithmetic progressions of primes since / J p ~ ^ p
is known tp diverge.
An arithmetic progression is commonly defined a.s s-\-nd for fixed s, d and consec
utive n; that is, the set S = {s,s-\-d,s + 2d,s + 3d,...,s + {n — l)d} is an arithmetic
progression. We use the term progression, without the qualifier arithmetic, to mean
a finite sequence. In the case that S is infinite, we will say arithmetic progression
sequence. An arithmetic progression free sequence is then rightly defined as an infi
nite set of integers such that no choice of any k > 2 elements falls into the previously
described formulation. Note that k must be greater than two; otherwise such a se
quence would never exist. Furthermore, a A;-term A.P. (A.P. will stand for arithmetic
progression from this point forward), is a finite sequence in which k terms follow the
prescription s,s-\-d,s-\-2d,... ,s +{k— l)d. Observe that a sequence with no 3-term
A.P. will not contain a 4-term A.P. and so forth.
The main concern of this paper is approaching Erdos' conjecture by the contra-
positive: If A does not contain arbitrarily long finite arithmetic progressions, does
y ^ a~^ necessarily converge? More specifically, we mainly concentrate on sets that aeA
do not contain any A.P. Hence it suffices to concentrate on sequences without a 3-
term A.P. We develop a construction to produce A.P.-free sequences; we then analyze
and oflter examples of the construction. Before we divulge the construction, we first
traverse through the ideas and formulations that lead to it.
CHAPTER II
ATTACK OF THE PROBLEM - BACKGROUND
2.1 Introduction
The study of arithmetic progressions, and a lack thereof, has been considered by
several well known authors, including Erdos and Turan [4], Guy [11], Odlyzko [15],
Newman [14], Grosswald [8] and [9], Gerver [6], and many others. Before proceeding
with our examination of the special case of Erdos' conjecture, we summarize some of
the known related results from the literature.
2.2 Known Results
Gerver [6] has shown that for each integer A: > 3, there exists a set Sk of positive
integers containing no A.P. of k terms, such that ^ n~^ > (1 - ^)k log A; for large neSk
k and e e R+-^. The S'fc's are generated recursively by the greedy algorithm in the
cases where k is prime. That is, n e jt if and only if {m e fc : m < n - 1} U {n}
contains no arithmetic progression of k terms.
Gerver and Ramsey [7] give a heuristic formula, supported by computational evi
dence, that describes the asymptotic density of Sk in the case where k is composite.
However, with a couple of assumptions, was shown to imply that the greedy algorithm
would not maximize TJ?^"^ over all S with no k-texva A.P. They then show that for neS
all e > 0, |5fc| < n is greater than (1 — e)y/2n for sufficiently large n.
Odlyzko and Stanely [15] construct sequences of positive integers, S{k), using the
greedy algorithm. Their sequence is constructed so that QQ = 0, ai — k and each a^^i
such that a„ < a„+i creates an A.P.-free sequence QQI «!, • • • < a„, a^+i. The greedy
algorithm does not, however, produce particularly dense A.P.-free sequences.
Dense sequences are of interest because it is easy to construct A.P.-free sequences
whose sum of reciprocals converge. For a quick example, consider any geometric series.
However, is it possible to construct A.P.-free sequences whose sum of reciprocals
diverge? If we can answer no, then consequently the answer to our question is fulfilled.
Hence we try to construct A.P.-free sequences in which the terms are "close" together
as possible. This leads us into the next idea.
2.3 Span and Its Impact
2.3.1 Definitions and Motivations
If we define the span of a set 5, as in Guy [11], to be span(S')= max |si - S2I, or ai,S2eS
sp(5), this gives us two tools. We can first compare the density of progressions. For
example, given the sets 5 = {1,5,10,17} and T = (1,2,4,5} we see that sp(5) = 17
1 = 16 while sp(T) = 5 1 = 4. Therefore, we say that T is denser than S. Secondly,
we may also "shift" sequences and progressions. Consider the sets S = {1,2,4,5}
and T = {6, 7,9,10}. Notice that sp(5) = sp(r) and | 5 | = \T\. Thus to us, the sets
are equivalent. We cay say this because the properties for which we are concerned
are invariant under translation. That is, we can define an equivalence relation on the
set of finite subsets of N by
S^T if and only if sp(5) = sp(T) and | 5 | = |T|.
It can be easily verified that this is indeed an equivalence relation. Although shifting
a sequence has no bearing on its convergence property, we shift sets such as T down
to sequences that start with one merely for convenience. Also, since we were concen
trating on finding dense sequences that contain no A;-term A.P., we started looking at
sets of n integers containing no 3-term A.P. that yielded the smallest span, defined
as sp(3, n).
The chase to answer the question "given n, what is sp(3, n)?" yielded two out
comes. First, we were able to extend the values for sp(3, n) in Guy [11]. Second, in
the search to further extend the values given, the idea of partitioning a number to
construct the progressions came into play.
2.3.2 Extension of Values
In a paper written by Erdos and Tiiran [4], they provide an upper bound on the
possible value of sp(3, n) given n. They define r{N) to be the maximum number of
elements in a finite sequence of integers ai < a2 < • • • < N containing no 3-term A.P.
exists. They give the upper bound as r(2N) < N if N >8. Translating this into our
language, we get sp(3, N) < . They also give the bound r{N) < ( - + e ) iV
for e > 0 and A > A'o(e). Notice that these bounds agree with the values given in
Table ILL
In spite of the bounds given by Erdos and Tiian, we wanted to find an explicit
function of n to describe sp(3, n). Because if we could, then that function could be
used to evaluate the convergence of the sum of reciprocals of A.P.-free sequences. This
idea inspired us to write a computer program to compute sp(3, n) for small values of
n.
The program found sp(3, n) by recursion. The first element was chosen to be one.
Then the next five possible values were computed. A sequence was built from each
of these choices. From these choices, the next five choices were created. This process
repeats until a sequence with the number of desired elements with the shortest span
is reached. Note that there are a finite number of choices; one can easily construct the
greedy algorithm sequence and use it as the comparison. That is, consider building
a finite sequence with five elements. The greedy algorithm gives a span of 9. So,
when building a finite sequence that already has 3 elements and has a span of 8, you
can quit building that sequence since adding any more elements into the sequence
will only make the span larger. The following tree illustrates the process. You first
start at 1; then you proceed to 2. The next five possible choices are 4,5,6,7, or 8.
So a sequence is then built from each of these elements so that you end up with the
sequences {1,2,4}, {1,2,5}, {1,2,6} and so forth. Then from each of these sequences,
the next five elements are computed and possible sequences are built from those five
choices. So each node in the tree branches in five directions. Nodes from 4 and 6
were omitted in the diagram for sake of space.
2
4 •• [8] a
3
... 9 10 6
5
... 12
6
Although we were able to extend the values given by Zalman Usiskin in Guy [11]
to n=22, not much else was gained. The sheer number of possibilities grows extremely
fast making the program ineffective for large values of n. The following table shows
our results and those of Zalman Usiskin. We did discover an error in their data, which
has been corrected here.
Table II.l: sp(3,n)
n
sp(3, n)
n
sp(3, n)
3
3
13
31
4
4
14
35
5
8
15
39
6
10
16
40
7
12
17
50
8
13
18
53
9
19
19
57
10
24
20
62
11 12
25 29
21 22
70 73
2.3.3 Partitions and Compositions
We now define two notions that will used extensively throughout the rest of of this
work. A partition of n G N is a representation of n as a sum of positive integers. In
a partition, the order of the summands does not matter. A partition is often written
in the form
n ai+ a2-i h Ofc,
where ai > a2 > • • • > ak > I-
A composition of n is a representation of n as a sum of positive integers in which the
order of the summands does matter. For example, the partitions of 3 are
3
2 + 1
1 + 1 + 1,
while the compositions of 3 are
3
2 + 1
1 + 2
1 + 1 + 1.
We next examined partitions of the span of a set of integers. The idea comes from
the fact that the difference between each consecutive elements of the sequence must
add up to the span of that set. That is, Y^HZI (• i-i-i ~ •s,) = sp(5'). Thus we asked
"given a positive integer, j , does there exist a partition of j into n — 1 parts such that
it yields an A.P.-free sequence of length n?" In a sense we tried to reverse engineer;
we attempted to find if an A.P.-free sequence of length n existed with a given span.
For example, let us examine possible progressions with a span of 3. What is the
greatest number of terms that can be used to create a progression with this property?
We could use two terms and make the progression S = {1,4}. Then sp(S')=3. But
does there exist a progression with three terms with the same property? We can
answer this question with the help of partitions. Let us look at the partition of 3 into
two parts, namely
2 + 1.
We then construct a progression as follows:
51 = 1
52 = 5i + 2 = 3
53 = S2 + 1 = 4.
That is, our resulting progression would then be {1,3,4}. However, upon closer
inspection we noticed that the partition 1 + 2 would have also worked. In other words,
we could have just as easily made our progression {1,2,4}. These two progressions
are considered denser than the progression {1,4} because they comprise more terms.
But these two progressions also raise another awareness: we need to concern ourselves
with compositions rather than strictly with partitions.
We then examine possible progressions with a span of 4 in which no A.P. occurs.
Since we are still concerned with the greatest number of terms in which this occurs,
we can immediately throw out compositions of 4 into 1 and 2 parts. We can do
this because compositions of 3 into 2 parts creates the minimum span for A.P.-free
progressions with 3 terms. In other words, 3 terms creates a minimum span of 3.
Hence it would be counter-productive to start trying to construct progressions with
3 terms that have a span of 4. Thus we determine if it is possible to construct a
progression with 4 terms that has a span of 4. We again employ the concept of
compositions to aid in the quest. Let us look at the compositions of 4 into 3 parts
2 + 1 + 1
1 + 2 + 1
1 + 1 + 2.
If we construct a progression from the first and last compositions we get an A.P- Using
the first composition as an example, we would get the progression {1,3, 4, 5} but the
subset {3,4, 5} forms an A.P. This example illustrates that compositions in which two
equal summands that appear consecutively cannot be used. Upon using the middle
composition to construct a progression we get {1,2,4,5}, which is an arithmetic free
progression.
Continuing in the same manner as before, we test to see if it is possible to con
struct an arithmetic free progression with 5 terms that has a span of 5. Listing all
possibilities of the compositions of 5 into four parts we get:
1+1+1+2
1+1+2+1
1+2+1+1
2+1 + 1 + 1.
Since every composition of 5 into 4 parts contains two equal consecutive summands,
an arithmetic free progression of span 5 with 5 terms does not exist.
We now determine the possibility of an arithmetic free progression with 6 terms
that has a span of 5. Therefore, we are interested in the compositions of 6 into 4
parts. We do not list all the compositions of 6 into four parts. Instead, we list one
in order to show the exact criteria the composition must meet. Let us examine the
following composition:
1 + 2 + 1 + 2.
If we choose to build a progression with this composition we would get {1, 2,4, 5,7}.
However, upon closer inspection, we see that {1,4, 7} forms an A.P. since each element
differs by three. If we look at the composition 1+2+1+2, we see that summing the first
and second integers equals the summation of third and fourth. Thus a composition
must satisfy the following condition in order for it to be used in construction of an
A.P.-free sequence.
Proposi t ion 2.3.1. A progression S constructed from a composition, A; = cj + C2 +
• • • + c„, such that di = i, 4 + i = Yl ^i> ^^ "-^ A.P.-free progression if and only if
y ^ Cj 7 y ^ Cj, for alla,b,s, 1 <a <s <b< <i<3 s<i<b
Proof Let Cl + C2 H 1- c„ be a composition such that ^ Ci= 22 ^^ ^°^ ^°"^^ a<i<s s<i<b
a,b,s, I < a < s < b <n. We now show that a progression constructed recursively
such that di = i,d2 = di-\-Ci,...,dn+i = dn + Cn contains an A.P. Notice that da =
da-1+Ca-i = k. We also have d^+i = ci,+c, = {da+Ca-i) + {ca+- • •+€,) = k+j. Then,
db+i = db+Cb = ( r fa - l + C a - l ) + (Ca+- • - + 0;,) = k+{Ca + - • • + C,) + (Cs+i + - " •+Cb) = k+2j.
For the case a = 1, notice that 4 = 1 = fc and then the rest follows in the same
manner.
Conversely, suppose that the progression di = l,dn-t-i = Yl ^ contains an A.P. l< i<n
We now wish to show that ^ Q = ^ Cj for some a,b,s, l<a<s<b<n. a<i<3 s<i<b
Since {dj^^^l contains an A.P., it follows that da = ^^ Ci = k. Then ds+i = l< i<a
/ ^ Ci = ^ Ci + 2_^ Ci = fc + j for some 1 < a < s. Then for some 6+ 1, we have l< i<s l< t<o a<.i<s
db+i = k-\-2j = ^ Ci + 2 ^ Ci = ^ Ci + ^ Ci + ^ Cj. It then follows that l< i<a a<i<a \<i<a a<i<a 3<i<b
y ^ Ci = 2_] Cj for some a,b,s, 1 < a < s < b < n. D a<i<s s<i<b
Remark 2.1. Notice that for any composition, k = ci + c^ + • • • + Cn, there are a
total ofY^^=\ k{n — A; + 1) inequalities that must be satisfied in the above theorem.
With this observation, the search for compositions yielding an A.P.-free set be
comes increasingly difficult. Also, the number of compositions of an integer A; into
n parts is {^Z\)- Thus the number of compositions grows rapidly very quickly. In
addition to the number of compositions, the search for viable compositions entails a
great of deal of calculation. Because of these two factors, a computer program was
written to aid in the process.
The program found viable compositions by brute force. It was given a number k
and the desired number of parts for A; to partitioned into. It would then partition
k into n parts and build the resulting finite sequence. The sequence would then be
tested for containment of an A.P. If the sequence contained an A.P., the program
would then permute the partition and build another sequence. The program would
try all permutations of every partition into n parts.
We were able to compile a list of compositions that resulted in A.P.-free sets of
order 17 that had a span of 50. After this, the algorithm becomes far too ineffi-
cient to continue. The next number to try next would be 51 into 17 parts, which
is 4,923,689,695,575 trials for possibihties. The chart below shows the results found,
compositions that are reversals have been eliminated:
Table II.2: Compositions
span(3,n)=A;
1
2
3
4
8
10
12
13
19
23
A; into n — I parts
0
1
2
3
4
5
6
7
8
9
Resulting compositions
1
1,2
1,2
2,1
1,2,1
1,2,4,1
1,4,1,2
1,2,1,5,1
1,2,4,1,2
1,2,4,2,1
2,1,4,1,2
1,3,2,3,1
1,2,1,5,1,2
1,2,1,5,2,1
1,2,4,2,1,2
1,2,1,5,1,2,1
1,4,1,2,5,1,3,2
1,3,2,4,5,2,1,4,1
10
span(3,n)=A;
25
29
31
35
39
40
50
k into n — 1 parts
10
11
12
13
14
15
16
Resulting compositions
1,3,2,4,5,2,1,4,1,2
2,1,4,1,2,9,2,1,4,1,2
1,2,4,1,2,8,3,1,3,2,3,1
1,2,4,1,4,8,2,3,1,3,2,3,1
1,2,1,5,1,2,1,14,1,2,1,5,1,2
1,2,1,5,1,2,1,14,1,2,1,5,1,2,1
1,2,1,6,2,1,2,13,5,1,2,1,8,2,1,2
1,2,1,6,1,3,1,16,2,3,1,5,2,1,4,1
1,3,1,6,2,1,2,4,14,3,1,3,5,1,2,1
Closer inspection of certain compositions yields interesting observations. For ex
ample, let us take a closer look at the compositions of sp(3,10). The second compo
sition, 1 + 2 + 4 + 1 + 2, can be thought of as the first composition of sp(3,3) + a
middle term + first composition of sp(3,3) in which the middle term is the smallest
value such that the resulting composition still gives rise to an A.P.-free sequence. We
use the following picture to illustrate:
1+2
1+2 u 1+2
The smallest value of /i that satisfies the equations in Proposition 2.3.1 is 4.
If we look at the composition obtained for sp(3,40), this can be thought of as
sp(3,13) plus 14 plus sp(3,13). In turn, sp(3,13) can be thought of as sp(3,4) plus
5 plus sp(3,4) and then even sp(3,4) can be reduced to sp(3,l) plus 2 plus sp(3,l).
11
These observations lead us into the next definitions.
We say that a composition, m = Ci + C2 -I 1- Cfc , is reducible when the following
condition is satisfied:
k — I Ci = c-,k±i for i = 1, . . . , —-— and for A; odd.
i-r 2 2
If a composition is not reducible, we then say that it is irreducible. If a composition
has an even number of summands, then by definition it is irreducible.
12
CHAPTER III
DESCRIPTION OF THE CONSTRUCTION
3.1 Introduction
The construction we present starts with a finite A.P.-free sequence which con
tains an irreducible composition and greedily constructs an A.P.-free sequence. The
construction follows the discussion in the previous chapter. We now describe it in
detail.
The basic idea is to start with an irreducible composition, Ci,. . . ,c„_i, that sat
isfies the conditions of Proposition 2.3.1. Then an exact copy of the composition is
appended leaving an open spot for a new value, /x, as in the following illustration:
< ^ l , * ' • I < ^ n — 1
Cl , - - - ,Cn- i , /i , copy
C l , • • • , C j i _ i , / i , C l , • • • , Cji—l •
The value of ^j, is then chosen so that the resulting composition still satisfies the
conditions of Proposition 2.3.1. This process is then repeated indefinitely.
Notice that after one iteration we have doubled the number of elements in the
sequence and then added one more. We can also re-index the resulting sequence as
follows:
di,- •• fdji-i, /^, di,- • • ,dn+i
di,- • • , dn-l, /^ = dn, dn+i, • • • , C?2n-1-
3.2 The Formal Description of the Construction
We now formally describe the process.
Let Cl , . . . , c„_i be positive integers, n > 2 such that
Y^ CiT^ Y^ Cj, for all l<a<s<b<n a<i<s s<j<b
The conditions above are equivalent to those in Proposition 2.3.1. Hence by Proposi
tion 2.3.1, the finite set of integers S = {m lA; < n, mi = 1 and m^ = Ei<i<jk ^i} also
contains no A.P. We now inductively define a sequence {dk] of positive integers by
13
/ Cfc, if 1 < A; < n
^k = \ fit, if k = 2'n for some t>0
4-2*n, if 2 * < A ; < 2 * + y
where fXt is the least positive integer such that for all 1 < a, 6 < 2^'^^n,
/it 7 J 3 a!j - ^ - Yl ^' ^°^ ^ 2*n + 1 < s < 6 (3.1) s<j<b 2'n+l<i<3 a<t<2*n
//f 7 ^ dj - ^ ^j ~ 5 Z J' ^°^ ^ a < s < 2*n. (3.2) a<i<s 2^n+l<j<b 3<j<2*n
Notice that in 3.1 and 3.2, the RHS takes only a finite set of possible values, and so
by the Well-Ordering principle, /it is well-defined.
The above two conditions are derived from the inequalities in Proposition 2.3.1.
Consider the first 2''^^n — 1 terms of {djb}.
From the equations in Proposition 2.3.1, we have
Y2 Ciy^ YJ ^J ^^^ all I <a,b< 2*+^n. a<i<s 3<j<b
First, let 2*n + 1 < s < 6. Then we may rewrite the above inequality as
Y^ di-bfit+ YL '^i^ Yl ^i' a<i<2*n 2*n-t-l<i<a s<j<b
and Equation 3.1 follows by solving for fif Likewise, let a < 5 < 2*n. Then we have
E dij^ Y2 dj + t^t+ Y2 ^y a<i<3 s<j<2 'n 2*n+l<j<b
Equation 3.2 then follows by solving for /i^.
We should remark here that this algorithm produces sequences that coincide with
the greedy construction of Odlyzko in certain cases.
14
3.3 Justification of the Construction
It is now necessary to show that any sequence constructed as above does not
contain an A.P.
Theorem 3.1. Let {dk} be a sequence constructed as above from Ci , . . . , c„_i. Then
1. For any \ <a < s <b,
Y^di^Yl r a<i<3 3<j<b
2. The subsequence d^On, c?2in) < 22n, • • • ^s strictly increasing.
Proof. We will prove 1 by induction. It is true f o r l < a < 5 < i ) < 2°n by assumption,
so suppose the result is true for all 1 < a < s < 6 < 2*n. By construction of {dk} and
the induction h5T)othesis, the result holds for 2*n < a < s <b < 2^^^n, so it remains
only to show that it holds for 1 < a < 5, 2*n < fe < 2'+^n.
First suppose that s < 2*n. Then
Y^di-Y^dj = Y di- Y2 ^i~ S ^ ~ * a<i<3 3<j<b a<i<s s<j<2'n 2'n<j<6
= J2 ^^~ J2 dj- ^ dj-^t a<i<3 2*n+l<j<6 3<j<2*n
^ 0
since jj-t satisfies 3.2.
Now suppose that s < 2*n. Then,
^ di- ^ d,- = Y di+iit+ Y "^'-Yl i a<i<a 3<j<b a<i<2'n 2'n<i<s 3<j<b
= Y2 di-^^t+ Yl di- Y2 dj a<i<2«n 2'n-H<i<s s<j<b
since / t satisfies 3.1.
We now prove 2. Notice that Ht+i > ^t by definition of Ht since /Xf+i must in
particular satisfy the same inequalities as does ^Xf Thus it suffices to show that
15
/ij+i 7 /ut- This follows immediately from part 1 by taking a = I, s = 2*n, b = 2*+^n:
l<i<2* 2 'n<j<2'+in
= ^ di + /ft - ^ dj - ^t^i
l<i<2* 2«n<j<2<+in
= E * " ' ~ E J ~ '"<+! l<i<2« l< j<2 'n
= lit- /if-H-
D
Corollary 3.1. Let Ci,. . . ,c„_i and {djt} 6e defined as above. Then the sequence
defined by Si = I, Sk+i = Sk -\- dk contains no arithmetic progressions.
Proof. Proof follows immediately from Proposition 2.3.1 since the conditions in The
orem 3.1 are equivalent to those in Proposition 2.3.1. D
16
CHAPTER IV
CONSEQUENCES OF THE CONSTRUCTION
After describing the construction, the next step was to determine if the sum of
the reciprocals of the constructed sequences converged. Thus a program was written
to compute many sequences. The first partition tested resulted in a key observation.
We noticed that the "middle term", //t+i, could be described by the summation of
the previous partition.
We started with the initial partition of 1. After one step in the construction, we
have the partition 1 + 2 + 1. The /i in this iteration is one more than the sum of
the previous partition. A second step in the construction arrives at the partition 1+
2 + 1 + 5 + 1 + 2 + 1. The n in this case is also one more than the sum of the
previous partition. Stepping through the algorithm again we see that the next /J, is
also one more than the summation of the previous partition. Upon recognizing this
pattern, the summation of the entire partition becomes easy to compute.
Table IV. 1: Greedy Algorithm
Iteration Resulting partition Summation
0 (starting partition) 1 1
1 1,2,1 4
2 1, 2, 1, 5, 1, 2, 1 13
3 1, 2, 1, 5, 1, 2, 1, 14, 1, 2, 1, 5, 1, 2, 1 40
Looking at the results of the algorithm, we see that the resulting summation is
3 times the previous summation plus 1. This comes from the fact that a copy of
the previous summation shows up twice in the next partition coupled with the fact
that the next /z is also one more than the sum of the previous partition. Hence the
summation of the previous partition shows up 3 times in the next partition.
The observation that // is 1 plus the sum of the previous partition makes it pos
sible to determine convergence of the summation of the reciprocals of the resulting
17
sequence created from the partition. Gerver, Propp, and Simpson [?] show that this
phenomenon continues for this particular sequence.
Consider the following (mjt is the actual sequence constructed from 4 ' s ) :
mi = 1
m2 = 1 + di
mn-i = 1 + di + •. • + dn-2
m ^ = 1 + di + • • • + dn-2 + dn-l = Mo
m„+i = 1 + di + • • • + d,i
m2n 1 + d i H h dn_i + dn + dn+i H 1- d2n-l = / i l
Notice that each term m2<n is the exact value of/i*. Now consider the following:
Table IV.2: Observation on the Sequence Constructed by the Greedy Algorithm
Terms in Resulting Sequence
mi through m.n-i
rUn through m2n-i
m2tn through m2(+in-i
Terms Dominate
1
/io
^t
Resulting Inequality
^i<i<n-i ; ^ < ( " ~ ^) • ^
2-/2'n<i<2*+in-l IT '^ ^ ^ ' TT
But the problem still remains to find the /i's, A program was created to extend the
sequence by using the construction. The program printed the resulting partition, the
summation of the the terms at each iteration, and the resulting progression created
from the partition. Using this information, we were able to determine a likely formula
for the /it's using hnear homogeneous recurrence relations.
By expanding the partition 1 by the algorithm we get the following partition after
four iterations:
18
1, 2, 1, 5, 1, 2, 1, 14, 1, 2, 1, 5, 1, 2, 1, 41, 1, 2, 1, 5, 1, 2, 1, 14, 1, 2, 1, 5, 1, 2, 1
The value of the /i's in order are 2, 5, 14, 41. We then set up the equations as
follows:
/il - / o = 5 - 2 = 3^
/i2 - /il = 14 - 5 = 3^
/ 3 - /i2 = 41 - 14 = 3^
tit+i-lit = 3*+\
Then by adding all the equations, we get
/ i t+ l — /«0 =
=
/^t+1 =
3(1 +• • • + 3*)
af--) 3'+2 _ 3
2 3*+2 - 3
2 -^2 3*+2 + 1
2
Now since each /it can now be described by a function oft, each nia=2^n can also be
described. Therefore, we now have the means to determine the convergence properties
of the sum of the reciprocals.
We now show the convergence of the sum of the reciprocals of the sequence con
structed by the greedy algorithm. Consider the discussion in table IV.2. Then we
have
mi > 1 impUes 1 < 1 2ra-l 20 . 2
m2, • • •, ma > /io imphes ^ m"^ < ^^^^ ^ ^
2i terms '" o
m2tn,.--,/i2'+tn-i > / t implies ^ m~^ < ^t+i ^ ^ ' "y i=2'n
2*71 terms o
19
Thus adding the inequahties in the last column we get
2* We now discuss the convergence of Y,Zi irnTi by use of partial summation.
Theorem 4.2. For x > 1,
limy X—»00 ^—^
2" 4 log 3 ^^^3-+i + c 91og(3/2)
where c € M."'"'''.
Proof We apply partial summation as in Nathanson [13] using functions / (n) = 2"
^^d 9it) = siTTTc ^^'"^ ^(^) = ^^^^ 2" = 2W+1 - 2 and 9'{t) = ^ ^ ^ ^ and
E n<x
(3^+1 + c)'
2"
3' +! + c
2W+1 _ 2 /-x log 3 (2W+1 - 2) 3*+
/ 3X+1 + c Yi (3*+i + c)^
2^+^ - 2 r i o g 3 _ 2 W + ^ 3 ^ _ r log3-3^+^
3 ^ + 1 + c ' ^ A (3Hi + c)^ ^ ^ - ^ 1 (3'+^ + c)^'
2 W + I - 2 Plog3-2-«2*+^3*+^ / 1 3^+1 + c
riog3-2-W2*+i3*+i , . / 1 1 \ + / —2 5 di + 2 I —-T
7i (3*+i + c) Vs' ^^ + c 9 + c ; 2^+^ - 2 4 log 3 log3-2^+^ 2(3^+^ - 9) < 3rr+i ^ c + 9(log3 - log2) 3^+i(log3 - log 2) ^ (3^+^ + c) (9 + c) ^ '^'
since
log3 • 2-»2*+^3*+^ , r log 3 • 2'+i3*+i 5 di < / 5—
(3«+i + c)^ A (3*+i + c)2 Mog3-2*+i3'+^
di
< / 3iiT2 ^*
4 log 3 Iog3-2^+13 z+lo—X—1
9 (log 3 - l o g 2) log 3 - l o g 2 4 log 3 log3-2^+i
9 (log 3 - log 2) 3^+1 (log 3 - log 2)
20
Now letting x —> oo on both sides of (4.1), we get
2" x-»oo ^-^ Rn-^ i-»oo "—' 3"+^ + c
n<x
,. / 2 ^ + ^ - 2 41og3 log3-2^+^ -' + < hm — + ———^-—-r - , , , , , „—•—— + x-oo\3^+i + c 9( log3- log2) 3^+i(log3-log2) (3= + + c) (9+ c)y
4 log 3 2 _ 9( log3- log2) 9 + c'
as desired. D
21
CHAPTER V
ANALYSIS OF THE CONSTRUCTION
In the last chapter, it was shown that the /it's for the greedy algorithm followed
a certain pattern. This is not, however, the general pattern for all sequences created
by our construction. Most of the sequences that use the initial composition given in
Table II. 2 seem to follow the same pattern previously described or something very
similar, vt any rate, these /it's are easy to describe. We now attempt to generalize a
I ti :i for all /it's with any initial composition.
Lemma 5.1. Let {dm} be a sequence constructed as above from c i , . . . ,c„-i. Then
for any T > t >0, we have:
1. di = di+2Tn-h2*n, fov all I < i < 2*n
' 'A = i-t-2<+in, for all iFn - 2*n < z < 2^n
3. dj = dj_2t+i„, for all 2^n < j < 2^n + 2*n
I dj = dj+2'n, for all 2^n - 2'^^n - 2*n <j< 2^n - 2*+in
Proof Notice that 1 follows immediately from the definition of {d„} since di^2Tn+2'n =
di+2Tn = di.
For 2, notice that we may write i = 2'^n - 2*n + j for 0 < ;' < 2'n. Then
i + 2*+^n = 2^n + 2*n + j for 0 < i < s^n. So, di+2t+in = < 2 n+2'n+j = dj by 1. And
then di = d2T-i„+...+2%+j = ^2T-2n+•••+2'n-i-j = ••• = dj.
To prove 3, let i = j -2*+^n. Then 2^n <j< 2^n+2*n implies that 2^n-2'+in <
i < 2^n.
Finally, for 4, notice that from 2 we can write di = dj+2'+in = dj-2Wn = < j-2«n for
2^n - 2*71 <j< 2^n. Then for i - 2*+^n, we have di = d2tn+i for 2^n - 2'+'^n - 2'n <
j < 2^n - 2'+in. °
Theorem 5.3. LetT > t+l. If ^T > Yl ^'' ^^^^ I^T > Yl ^'• l<t<2 'n l<i<2 'n
22
Proof. Assume by contradiction that /iy < Y^ di. Let A = Y_j di — fxr > 0-l<t<2«n l< i<2 'n
We now will show that /if — A = /ix — 2_> ' i satisfies 3.1 and 3.2 thus contradicting l<i<2«n
the minimality of fit- We now proceed by cases.
Case 1: Now suppose, by way of contradiction, that there exist 1 < a < 2*n < b <
2*"'" n and s G [a, 2'n] so that Y^ c i = ^ dj + /tf - A + ^ dj. We then have a<i<3 s<j<2*n 2*n<j<b
5 ; ] d i = 5 ^ d, + / i r - 5 ^ cii+ 5 ^ dj. (5.1) a<j<s s<j<2'n l< i<2 'n 2*n<j<b
Now let a = 2^n-2*n + a, 6 = 2^n-2*n + 6 and s = 2^n-2*n + s. Then substituting
into equation 5.1, we have,
Y^di^ Y2 dj+fiT- Y di-^ Y2 ^r a<i<3 3<j<2'^n l< i<2 'n 2^n<j<6
Which upon simplifying, we get
E ^ ^ + E ^^= E^r (5-2) a<i<3 l<i<2*n s<j<6
We now have 2^n - 2*n + 1 < o < 6 < 2^n + 2*n, s e [a, 2^n]. FVom Lemma 5.1, we
have the following identities:
l<j<2*n 2^n-2'+in+l<i<2Tri-2«n
^ * = i : d. (5.4) 2^n-2«n<i<a 2^Ti-l-2'n<i<a-|-2«+in
b-2«+in<i<2Tn-2'n fa<j<2rn+2«7i
x: *= E * ( •' ' b-2 '+in<i<2^n-2«n 6-2'+in-2'n<i<2^n.-2*+in
Notice that from Equation 5.5 and Equation 5.6, we have
6-2 '+in-2<n<i<2^n-2 '+in 6<j<2^n-f-2'n
23
By substituting Equation 5.3 into equation 5.2 and adding the LHS of Equation 5.4
and Equation 5.7 to the LHS of equation 5.2 while adding the RHS of Equation 5.4
and Equation 5.7 to the RHS of equation 5.2, and we get the following
Y2 di + E di + Yl di + E di a<i<3 2^n-2 '+in<i<2 ' rn-2*n 2^n-2 'n<t<a i -2*+in-2<n<i<2^n-2 '+in
= E ^- + E .- + E dj. (5.8) | < j<6 2^n+2«n<j<a-|-2«+in b<j<2^n-t-2«n
We use the following picture to illustrate the substitutions:
LHS LHS LHS T TTQ 5.7 5.3 5.4 ^ "^ /ir 5 4
a 8 „ „ „ RHS RHS ^ " ^ 5.7 5.4
where
1. 6-2*+^n
2. 2^n - 2*+in + 1
3. 2^n -2*n
4. 2^n + 2*n
5. 2^n + 2'n + a.
Then by simplifying Equation 5.8, we have
E *= E " 5_2<+in-2'n<i<s 3<j<a+2^+^n
contradicting the definition of /ir-
24
Case 2: Now suppose, by way of contradiction, that there exist 1 < a < 2*n < 5 <
2'+^n and 5 € [2*n, b] so that ^ d. + /xt - A + Y2 di = Y, dj. We then have a<i<2'n 2«n<i<a s<j<fe
E di + fiT- Yl dj+ Yl di= Yldj (5.9) a<i<2*n l< j<2 'n 2*n<i<s 3<j<b
Now let a = 2^n-2*n + a, b = 2^n-2*n + 6 and s = 2^n-2*n + s. Then substituting
into equation 5.9, we have,
Y2 di-^fiT- Y2 dj+ Y2 di= Yldj. a<i<2Tn \<j<2*n 2^n<i<s 3<j<b
Which upon simplifying, we get
Y^di^Yld^^ E dj. (5.10) a<i<s s<j<b l<j<2*n
We now have 2^n - 2 * n + l < a < 6 < 2^n + 2*n, s G [2^n, 6]. Prom Lemma 5.1, we
have the following identities:
Y2 di= Yl di (5.11) l<i<2«n 2^n-t-2*n-l-l<t<2^n+2*+in
Yl di= Y. di (5.12) 2Tn-2 'n<i<o 2^n+2«+ira<i<a-t-2*+in-H2'n
By substituting Equation 5.11 into Equation 5.10 and adding the RHS of Equation 5.7
and Equation 5.12 to the RHS of Equation 5.10 while adding the LHS of Equation 5.12
and Equation 5.6, we get the following
Y2 di-h Yl di+ ^di= ^ dj^ 6-2«+in<i<2^n-2*n 2^n-2*n<i<o a<t<s s<j<b
Y. dj+ Y. d,+ Yl rfr (5.13) 6<i<2^n-|-2'n 2^n-t-2'n+l<t<2''n+2«+in 2^n-(-2'+in<i<d+2«+in+2«n
We use the following picture to illustrate the substitutions:
25
LHS LHS 5.6 5.12 LHS
^ " ^^ RHS ^HS RHS RHS
"•^^ 5.7 5.11 5.12
where
1. i - 2 '+ i7 i
2. 2 ^ n - 2 « n
3. 2^n + 2*n
4. 2^n + 2*+in
5. a + 2*+in + 2*n.
Then by simpUfying Equation 5.13, we have
Y di= Yl dj, 6-2«+in<i<s s<j<a-|-2*+in+2*n
contradicting the definition of / i j . D
The last piece of the puzzle in order to show that the sum of the reciprocals of
the sequences created using our construction converges is the following theorem.
Theorem 5.4. IfT> i + 2 and fix > / J di, then /ir > T j d^. l<i<2«n l<i<2 '+ln
Proof Assume by contradiction that / i r < Y_] di. Let A = V ] di — iLiT>0. l<i<2'+ln l<i<2'+^n
We now will show that /if+i — A = /ir — 2_^ di satisfies 3.1 and 3.2 thus contra-l<i<2«+in
dieting the minimahty of /it+i- We now proceed by cases.
Case 1: Now suppose, by way of contradiction, that there exist I < a < 2*^^n <
b < 2^-^'^n and s e [a, 2*n] so that Y di= E dj + f^t+i - A + ^ dj. We a<i<s s<j<2^+^n 2'+^n<j<b
26
then have
Ydi= Y dj-hfiT- Y di+ Y dj. (5.14) a<i<9 3<j<2'+^n l<i<2«+in 2*+in<j<6
Now let a = 2^n- 2'+'^n + a, 6 = 2^n - 2*+^n + 6 and s = 2^n - 2*+in + 5. Then
substituting into equation 5.14, we have,
Y2di= Yl dj + fiT- Yl di+ Y2 dj. a<i<S 3<j<2^n l<i<2'+^n 2Tn<j<b
Which upon simplifying, we get
Ydi+ Y di= Y2 dj- (5.15) a<i<s l<i<2*+ira 3<j<b
We now have 2^n - 2*+in + 1 < o < 6 < 2^n + 2*+^n, s e [a, 2^n]. From Lemma 5.1,
we have the following identities:
Y di= Y di (5.16) l<i<2<+in 2^n-2 '+2n+l<i<2^n-2 '+ in
Y di= Yl di (5.17) 2Tn-2*+in<i<a 2^n+2'+in<i<a-f2*+2n
Y di= E dj (5.18) b<t<2^n+2*+in b-2'+2n-2'+in<i<2^ra+2'+2n
(5.19)
By substituting Equation 5.16 into equation 5.15 and adding the LHS of Equation 5.17
and Equation 5.18 to the LHS of equation 5.15 while adding the RHS of Equation 5.17
and Equation 5.18 to the RHS of equation 5.15, and we get the following
Y di + Y di + Y2 di + Yl di a<i<S 2^n-l-2*+in<i<2^n-2'n 2^n-2 'n<i<d b-2«+in-2*n<i<2Tn-2<+in
= Ydj + Y dj + Yl d,. (5.20) s<j<b 2^n-l-2*n<j<a-t-2'+in i<j<2^n+2«n
Then by simplifying Equation 5.20, we have
E i = E dj, 6_2«+in-2'n<i<s s<j<a+2^+^n
27
contradicting the definition of /iy.
Case 2: Because Case 1 is so similar to Case 1 of the previous theorem. Case 2 is also
very similar.
D
We now show that the sequence built from our construction converges.
Corollary 5.2. Let {mk} be a sequence constructed as above. Then V^ — converges. ^ ^ mk k>\ "
Proof. By Theorems 5.3 and 5.4, we have
/iy > Y2 di. l<i<2*+in.
It then follows that
/iT+3 > Y di = Y di + l^T+ Y di + /iT+l l< i<2^+in l<i<2^n 2^n+l<i<2T+in
= Y2 di-\- IJ,T+ Y2 di + AtT4-l l<t<2^n l<i<2^n
= 2 Y^ di-\- HT + /ir+1 l<t<2^n
> 3/ir
Then notice that by the same argument we have
/ iT+4 > 3 / iT+l
/ iT+5 > 3/iT+2-
Continuing in the same manner, we now have the following for A; = 1,2,3,. . .
/iT-(-3fc > 3 / I T
ofe /ir+3A;+l > •J /^T-hl
/ir+3A:-|-2 > 3 /iT+2-
28
Notice that
m2T+3+o„+i through m2T+3+i„ > 3/ir
m2T+3+i„4.i through m2r+3+2„ > 3/tr+i
m2T+3+2„ .i through m2T+3+3n > 3/ir+2
"2 +3+7,1+1 through m2T+3+o+i) > S^^^i-^^fxr+j mods.
Therefore it follows that
^-^ m.1. ^—^ m.,. ^-^ k>l ^ ' ^ k<^^^n "^^ j>0 m,
2T+3+j„<i<2T+3+(j + l ) „ •>
E -i<2T+3+(j + l ) „ J
< V ^ + 8-2^ V # - + 8-2^ T
8-2- Yl
+
2
,=2,5,8,... ^ ^ 2 ^ + 2
^ V^ 1 8-2^ v ^ 2 ' 8-22' v-^ 2-'' 8-2^ v ^ 2 < > — - \ > —H > —H > — ~ •^^ ' mfc UT ^-^ 3? UT4-1 ^^-^ 3^ /iT4-2 " ^ ^ 3?
fc<2T+3 1: ' •f j=0,3,6,... ^ ^ + S = 1 , 4 , 7 , . . . '^• '+^ j=2,5,8,... < OO.
a
29
BIBLIOGRAPHY
[1] H. L. Abbott and A. C. Liu. On partitioning integers into progression free sets. J. Combinatorial Theory Ser. A, 13:432-436, 1972.
[2] H. L. Abbott, A. C. Liu, and J. Riddell. On sets of integers not containing arithmetic progressions of prescribed length. J. Austral. Math. Soc, 18(2):188-193, 1974.
[3] J. Bourgain. On triples in arithmetic progression. Geom. Fund Anal, 9(5):968-984, 1999.
[4] P. Erdos and Turan. On certain sequences of integers. J. London Math. Soc, 11:261-264, 1936.
[5] Joseph Gerver, James Propp, and Jamie Simpson. Greedily partitioning the natural numbers into sets free of arithmetic progressions. Proc. Amer. Math. Soc, 102(3) :765-772, 1988.
[6] Joseph L. Gerver. The sum of the reciprocals of a set of integers with no arithmetic progression of A; terms. Proc Amer. Math. Soc, 62(2):211-214, 1977.
[7] Joseph L. Gerver and L. Thomas Ramsey. Sets of integers with nonlong arithmetic progressions generated by the greedy algorithm. Math. Comp., 33(148):1353-1359, 1979.
[8] E. Grosswald. Arithmetic progressions of arbitrary length and consisting only of primes and almost primes. J. Reine Angew. Math., 317:200-208, 1980.
[9] Emil Grosswald. Arithmetic progressions that consist only of primes. J. Number Theory, 14(1):9-31, 1982.
[10] Emil Grosswald and Peter Hagis, Jr. Arithmetic progressions consisting only of primes. Math. Comp., 33(148): 1343-1352, 1979.
[11] Richard K. Guy. Unsolved problems in number theory. New York; Berhn: Springer-Verlag, cl981, first edition, 1981.
[12] Donald L. Kreher and Douglas R; Stinson. Combinatorial Algorithms: Generation, Enumeration, and Search. CRC Press, 1998.
[13] Melvyn B. Nathanson. Elementary methods in number theory, volume 195 of Graduate Texts in Mathematics. Springer-Verlag, New York, 2000.
[14] D. J. Newman. Sequences without arithmetic progressions. In Analytic number theory (Philadelphia, Pa., 1980), volume 899 of Lecture Notes in Math., pages 311-314. Springer, Berhn, 1981.
30
[15] A.M. Odlyzko and R.P. Stanely. Some curious sequences constructed with the greedy algorithm. 1978. unpublished Bell Laboratories report.
[16] Paul A. Pritchard. Long arithmetic progressions of primes: some old, some new. Math. Comp., 45(171):263-267, 1985.
[17] Paul A. Pritchard, Andrew Moran, and Anthony Thyssen. Twenty-two primes in arithmetic progression. Math. Comp., 64(211): 1337-1339, 1995.
[18] R. A. Rankin. Sets of integers containing not more than a given number of terms in arithmetical progression. Proc Roy. Soc. Edinburgh Sect. A, 65:332-344 (1960/61), 1960/1961.
[19] Klaus Roth. Sur quelques ensembles d'entiers. C. R. Acad. Sci. Paris, 234:388-390, 1952.
[20] E. Szemeredi. Integer sets containing no arithmetic progressions. Acta Math. Hungar., 56(1-2): 155-158, 1990.
31
APPENDIX C++ CODE
32
Composition Algorithm
#include <stdio.h> #include <math.h> #include <iostreain.h> #include <vector.h>
in t a[100] in t b[100] in t c[100] in t seq[100]; in t p i [100] ; in t rho[100]; omitNext[100]; in t s i z e ;
in t min(int a, i n t b) { if(a<=b) {
r e tu rn a; } e l se i
re tu rn b; >
>
void buildSequenceCint N, in t *c) { seq[ l ] = 1; seq[2] = seqCl] + c [ l ] ; i n t i = 3; i n t k = 1; i n t done = 0; i n t next; while( i <= N+2 && done != 1) {
forCint j = i - 1 ; j >= 1; j ~ ) { omitNext[k] = 2*seq[ i - l ] - s e q [ j ] ; k++;
>
next = s e q [ i - l ] + c [ i - l ] ; forCint t = 1; t <= k - l ; t++) {
if(next!=omitMext[t]) { i f ( t==k- l ) {
seq[ i ] = next; i++;
33
} > else { done = 1;
>
>
if(i-l==N+2) { forCint g = 1; g <= N+1; g++) { printf("V.d ",seq[g]);
}
cout « endl; }
>
}
int permLexSuccessorCint n, int *pi) { pi[0] = 0; int i = n - 1; while (pi [i+1] <= pi[i]) {
i~; } if( i == 0 ) { return 0;
>
else { int j = n; while (pi [j] <= pi[i]) t
j — ; } int t = pi[j] ;
p i [ j ] = P i t i ] ; p i [ i ] = t ; f o r ( i n t h = i + 1; h <= n; h++)
rho [h] = pi [h] ;
forCint h = i + 1; h <= n; h++) pi[h] = rho[n+i+l-h] ;
r e tu rn 1; }
>
void conjPartCint •a, int size) {
34
forCint i =1; i < = a [ l ] ; i++) b [ i ] = l ;
forCint j=2; j<=size; j++) forCint i =1; i <= a [ j ] ; i++)
b [ i ] = b [ i ] + l ; i n t k = 1; forCint i = a [ l ] ; i>=l; i ~ ) {
c [k] = b [ i ] ; k++;
>
//now make the function call to build and test sequences from the partition
//make function call with c, then do a while loop testing permLexSuccessor
whileCpermLexSuccessorCk-l,c)==l) {
buildSequence Ck-1,c);
}
}
void genPartitionCint m, int B, int N) {
ifCm==0) { forCint i=l; i<=N; i++) {
printfC"y.d ". a[i]);
}
printfC"\n");
}
else { forCint j=l; j<=minCB,m);j++) {
a[N+l]=j; genPartitionCm-j,j.N+1);
>
>
void partitionNintoKPartsCint m, int B, int N) -C
ifCm==0) { conjPartCa, N);
>
else { forCint j=l; j<=minCB,m); j++) (
a[N+l]=j; partitionNintoKParts Cm-j,j,N+1);
}
}
}
35
int mainC) { int k,n;
cout « "Enter a number to be partitioned: ";
cin » n;
cout « "How paurts to be partitioned into: ";
cin » k;
a[l]=k;
partitionNintoKPartsCn-k,k,1);
}
Main Algorithm
#include <stdio.h> #include <math.h> #include <iostream.h> #include <vector.h> #include <string> #include <fstream>
int seq[100000] ; int d[100000]; int tempH[100000]; int place[100000]; int s [100000]; int x[10000] ; int actualSeq[100000]; int omit[1000000]; int S[1000000];
void buildSeqCint r, int noe. int *d, int TNOE) {
int tnoE;
int cnoE = noe;
int temp;
int xHolder = 1;
int next = 1;
forCint i = 1; i <= cnoE; i++) {
tempH[i] = d[i];
}
whileCr > 0) {
36
forCint i = 1; i <= 1000000; i++)-C
omit[i] = 0;
>
/ / t h i s creates [ block i ] [space] [block i] tnoE = 2 * cnoE + 1; forCint i = 1; i <= cnoE; i++) {
seq[i] = tempH[i] ;
seq[cnoE + 1 + i] = tempH[i];
>
temp = 0;
forCint i = 1; i <= cnoE; i++) {
temp = temp + seq[i]; } //SO x[xHolder] = temp;
int tempF = 0;
int tempB = 0;
forCint i = 1; i <= cnoE; i++) {
tempF = tempF + seq[cnoE + 1 - i] ;
tempB = tempB + seq[cnoE + i + 1] ;
omit[tempF] = 1;
omit[tempB] = 1;
>
int j = 1; forCint i = 1; i <= 1000000; i++) {
ifComit[i]==l){ place[j] = i ;
} }
next = next + 1; int foundNext = 0; int sum; int temp2 = 0; int temp3 = 0; //START
whileC foundNext != 1) { int fNextl = 1;
37
whileC fNextl <= j-1 ) { ifCnext == place[fNextl]) [ next++; fNextl = 1;
} fMextI++;
>
seq[cnoE + 1] = next;
S[l] = 1; forCint i = 1; i <= tnoE; i++) i
S[i+1] = S[i] + seq[ i ] ; }
int count = 0; forCint a = 1; a <= tnoE - 1; a++) { forCint b = a + 1; b<= tnoE ; b++) { forCint c = b + 1; c <= tnoE + 1; C++) { temp2 = S [b] - S [a] ; tempS = S [c] - S [b] ; ifC temp2 == tempS) { count = count + 1;
>
>
} ifCcount >= 1) { next++;
} else { foundNext = 1;
} } //END
seq[cnoE + 1] = next; forCint i = 1; i <= tnoE; i++) tempH[i] = seq[i] ;
cnoE = tnoE; tnoE = 2 * cnoE + 1; xHolder++;
38
r~; }//end while loop
temp = 0; forCint i = 1; i <= cnoE; i++) { temp = temp + seq[i];
} x[xHolder] = temp;
///////////////////////////////////////////////////////////
ofstream out C"nameOfTextFileToPrintTo.txt"); out « "The partition: " « endl; ///////////////////////////////////////////////////////////
// THIS IS THE PARTITION OUTPUT////////////////////////// forCint i = 1; i <= cnoE; i++) { ifC 17.30 == 0) { out « seq[i]; out « endl;
} else { out « seq[i] « " ";
>
>
out « endl; out « "Now the x[] values: "; forCint i = 1; i <= xHolder; i++) out « x[i] « ". ";
out << endl; out « "Total number of elements: " « TNOE « endl; out « endl;
actualSeq[1] = 1; forCint i = 1; i <= cnoE; !++)•[
ac tualSeq[ i+l ] = actualSeq[i] + s e q [ i ] ;
}
iiiiiiiiiiiiiiii////iiii/n//niiJi/////iiiii/f/iiii"i //this is the actual sequence output forCint i = 1; i <= cnoE; i++) { ifC iy.20 == 0) {
39
out « actualSeq[i]; out « endl;
} else { out « actualSeq[i] « " ";
} >
//now we compute the sum of the reciprocals long double recipSum = 0; forCint i = 1; i <=cnoE; i++) recipSum = recipSum + Clong double) l/actualSeq[i];
out « endl; out « "The sum of the first " « cnoE « " elements"'; out « "as reciprocals in sigma: " « endl; out.precisionClS); out « recipSum;
}//end function
int mainC) { s[0] = 0; int cnoe = 0; int cont = 1; int repeat, tnoe;
whileCcont == 1) { cnoe++; cout « "Element number " « cnoe « ": "; cin » s[cnoe]; cout « "Continue?"; cin » cont;
cout « endl;
>
cout « "Enter number of times to run buildSeq: ";
cin » repeat; tnoe = cnoe; forCint i = 1; i <= repeat; i++) {
tnoe = tnoe*2 + 1;
}
40
cout « "\n This will create: " « tnoe « " elements." « endl;
buildSeqCrepeat. cnoe, s, tnoe);
41
PERMISSION TO COPY
In presenting this thesis in partial fulfillment of the requirements for a master's
degree at Texas Tech University or Texas Tech University Health Sciences Center, I
agree that the Library and my major department shall make it freely available for
research purposes. Permission to copy this thesis for scholarly purposes may be
granted by the Director of the Library or my major professor. It is understood that any
copymg or publication of this thesis for fmancial gam shall not be allowed without my
further written permission and that any user may be liable for copyright infringement.
Student Signature Date