Download V3(x) Program, written in C

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Addition wikipedia , lookup

Location arithmetic wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

List of prime numbers wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Elementary mathematics wikipedia , lookup

Collatz conjecture wikipedia , lookup

System of polynomial equations wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

Transcript
Waring’s Problem
A Junior Seminar Project by
Jorge A. Cisneros
10 July, 2001
Junior Seminar
TABLE OF CONTENTS:
Waring’s Problem:
pp. 2 – 11
Program for v3(x), written in C computer
Language:
pp. 12 - 13
Program for r3(x), written in C computer
Language:
pp. 14 - 15
Program for σ, written in C computer
Language:
pp. 16 - 18
Gathered data on Waring’s Problem
on Excel spreadsheets:
pp. 19 - 21
Graph of r32(x):
p. 22
Graph of r33(x):
p. 23
Graph of global v3(x)/x:
p. 24
Graph of v3(x) in blocks of 100,000:
p. 25
Special Thanks:
p. 26
References:
p. 27
“No doubt about it, Ellington – We’ve mathematically expressed the purpose of the
universe. God, how I love the thrill of scientific discovery!”
--The Far Side
For my Junior project, I studied a special case of Waring’s problem. First of all,
what is Waring’s problem? Waring’s problem is to prove that every non-negative integer
is the sum of a bounded number of kth powers (Melvyn Nathanson, Additive Number
Theory: The Classical Bases, Chapter 5). That is, the number of s-tuples (x1, x2, x3, … xn)
of positive integers such that:
N = x1k + x2k + … + xsk
N, x1k, x2k, …, xsk ∈ ℤ+
My special case is as follows: how many numbers can be written as the sum of
three cubes? In other words, how many numbers m can be written in the form:
m = x3 + y3 + z3
x, y, z, m ∈ ℤ+
We define the function r3(m) = r3,3(m) as the number of representations of a non-negative
integer as the sum of three non-negative cubes. A few other functions were also
investigated. One of which is S3(x) = ∑r32(m), for m ≤ x, which answers the question of
how many solutions are there to the equation:
x13 + x23 + x33 = y13 + y23 + y33
(☼)
I also checked v3(x), which is the number of non-negative numbers between 1 and
x that can be written as the sum of three cubes. This can also be written as ∑Y(m), where
Y(m) = 1 if m can be written as the sum of three cubes, or
= 0 otherwise
First, let us look at the theory behind this. Hardy and Littlewood proved that
there is an asymptotic formula for r3(m) for nine or more variables. They proved that for
s ≥ so(k), there exists δ = δ(s,k) > 0 such that:
rs,k(m) = σ(m)Γ(1 + 1/k)-s Γ(s/k)-1ms/k –1 + O(m(s/k) –1-δ)
where Γ is the gamma function, and σ(m) is the “singular series”, which is a function that
is bounded above and below by positive constants depending on k and s (Nathanson, p.
118). This formula holds for so(k) = 2k + 1.
In order to get their asymptotic formula, Hardy and Littlewood used the circle
method. This is the original version they introduced. Let A be a set of non-negative
integers. The generating function for A is
f(z)3 = ∑ rA,3(m)zm
Here, rA,3(m) is the number of solutions to our equation m = x3 + y3 + z3, where x,
y, z ∈ A. Using Cauchy’s theorem, we find that:
rA,3(m) = 1/(2πi) ∫|z| = ρ f(z)3/zm+1 dz , ρ ∈ (0, 1).
This was simplified and improved by Vinogradov by replacing the power series f(z) with
a polynomial (Nathanson, p. 118):
p(z) = ∑(a ∈ A, a < m) za
And this means that:
p(z)3 = ∑3m rA,3(m)(t)zt
t=0
Since the elements of A are non-negative, we find that rA,s(m)(t) = rA,s(t) for t ≤ m and
rA,s(m)(t) = 0 for t > 3m. Now, let z = e(α) = e2πiα, and we get the trigonometric
polynomial
F(α) = p(e(α)) = ∑(a ∈ A, a < m) e(aα)
Which leads to:
F(α)3 = ∑3m rA,3(m) (t) e(mα)
t=0
Using basic orthogonality relations for e(nα), we get:
∫[0,1] e(mα)e(-nα) dα = 1 if m = n
= 0 if m ≠ n
⇒ rA,3(m) = ∫[0,1] F(α)3 e(-mα) dα
And, for my special case of Waring’s problem:
⇒ r3,3(m) = ∫[0,1] F(α)3 e(-mα) dα
⇒ r3(m) = ∫[0,1] F(α)3 e(-mα) dα
The difficulty lies in computing this integral. It cannot be solved in terms of
elementary functions. The best that can be done is estimating it. What Hardy and
Littlewood did was split the interval [0,1] into two sets: the “major arcs” and the “minor
arcs.” The major arcs, M, consist of all α ∈ [0,1] that can be “well-approximated” by
rational numbers up to a certain point (Nathanson, p. 123). All α ∈ [0,1] that cannot be
make up the minor arcs, m (Nathanson, p. 123). So our integral now looks like this:
r3(m) = ∫M F(α)3 e(-mα) dα + ∫m F(α)3 e(-mα) dα
Let us take a look at the minor arcs:
∫m F(α)3 e(-mα) dα
Most of the mass of the interval lies in this part. However, thanks to Hua’s
Lemma and Weyl’s Inequality, we find that this contributes a negligible amount to r3(m)
for nine variables, and this makes up only part of the O(N(s/k) –1-δ) part of Hardy and
Littlewood’s asymptotic formula. (Nathanson, p. 124-25). So the main interest is to the
major arcs M. My project will investigate whether or not the minor arcs also contribute a
small amount for three variables. Finally, we will also study if the trivial permutation
solutions and expected major arc solutions are independent. In other words, can we add
these two numbers and get the correct number of solutions?
The major arcs
∫M F(α)3 e(-mα) dα
while much smaller than m, make the bulk of the solution to r3(m). This factors into the
product of two terms: “the singular integral” A1 and “the singular series” σ (Christopher
Hooley, “On Some Topics Connected with Waring’s problem”, p. 113).
The singular integral is a gamma function:
∫u1^l + u2^l + …+ ul^l ≤ 1 du1 du2 …dul = 1/(ll) Гl(1/l) = A1.
Solving this explicitly for l = 3, hence
∫u1^3 + u2^3 + u3^3 ≤ 1 du1 du2 du3 = 1/(33) Г3(1/3) = A1
we find that the singular integral A1 has the value of about .712 (Hooley, p. 113).
The singular series for ☼, σ, looks like this:
σ = ∏p(1 – (1/p3))-1 (τ’(2)/25) (τ’(9)/95) ∏p≡1 mod 3 (τ’(p)/p5) ∏p≡2 mod 3, p≠2 (τ’(p)/p5)
where p is a prime number and τ’(p) is the number of incongruent primitive solutions to
m13 + m23 + m33 - m43 - m53 - m63 ≡ 0 mod p.
∏p≡1 mod 3 (τ’(p)/p5) is for all primes which is congruent to 1 mod 3. ∏p≡2 mod 3, p≠2
(τ’(p)/p5) is for all primes which is congruent to 2 mod 3, except for p = 2, which is found
explicitly with (τ’(2)/25). (τ’(9)/95) represents the number of solutions for 3. Simplifying
this equation, we find:
σ = ζ(3) (τ’(2)/25) (τ’(9)/95) ∏p≡1 mod 3 (τ’(p)/p5) ∏p≡2 mod 3, p≠2 (τ’(p)/p5)
First of all, let us take a look at ∏p≡2 mod 3, p≠2 (τ’(p)/p5). Let fp(n) be the number of
x mod p such that x3 = n. We find that for all p ≡ 2 mod 3, fp(n) = 1. This is because x 
x3 is an isomorphism of the multiplicative group for p ≡ 2 mod 3, and thus there is a oneto-one correspondence between x and x3 (Jordan Ellenberg, “Number Theory”, from his
private files). Thus we find that there are p5 solutions for m13 + m23 + m33 - m43 - m53 m63 ≡ 0 mod p. Since the case p = 2 is considered separately, we find:
∏p≡2 mod 3, p≠2 (τ’(p)/p5) = ∏p≡2 mod 3, p≠2 (1 – (1/ p5)) = .99967…
We also have the value of ζ(3), which is roughly 1.2020. Computing by brute
force, we find that:
(τ’(2)/25) = 31/32
(τ’(9)/95) = 140/81
Putting this all together:
σ = ζ(3) (τ’(2)/25) (τ’(9)/95) ∏p≡1 mod 3 (τ’(p)/p5) ∏p≡2 mod 3, p≠2 (τ’(p)/p5)
= (1.2020) (31/32) (140/81)(.99967) ∏p≡1 mod 3 (τ’(p)/p5)
= (1.2020)(0.96875)(1.7284)(.99967) ∏p≡1 mod 3 (τ’(p)/p5)
= 2.01195(∏p≡1 mod 3 (τ’(p)/p5))
So the only number left to check is (∏p≡1 mod 3 (τ’(p)/p5)). Now, in order to do
this, we must figure out how many incongruent primitive solutions there are to:
m13 + m23 + m33 - m43 - m53 - m63 ≡ 0 mod p.
First of all, without loss of generality, we can instead find the solutions to:
m13 + m23 + m33 + m43 + m53 + m63 ≡ 0 mod p.
This is because we are working mod p, and therefore the numbers ranging from m43 and
-m43 are the same. Next, we find that the product of these values for p = 7, p = 13, and p
=19 is 1.539. Finally, according to Hooley, the product of everything else is between 1
and 1.005 (Hooley, p. 118).
Finding this out using a computer program was a bit difficult. First I tried the
obvious method of making six different loops for
m13 + m23 + m33 + m43 + m53 + m63 ≡ 0 mod p
and finding every solution. Unfortunately, efficiency is almost non-existent, even for
relatively small primes (i.e. primes less than 100). So a few shortcuts were made. First
of all, the workload was cut in half in the sense that we are only looking at p ≡ 1 (mod 3),
since p ≡ 2 (mod 3) was in fact (1 – 1/p5) (Hooley, p. 118). This converges really
quickly, and it is enough to check only two primes to see the estimate above, with an
error of only about 1/p4. To solve p ≡ 1 (mod 3) we take advantage of its primitive roots.
Since each prime we are looking at is 1 mod 3, we took one of its primitive roots and
cycled the program only up to p/3, cutting the workload by a factor of 36. This is because
each non-zero cube occurs with a multiplicity of three. From there, we checked the
values of a generator g of p, raised from the 0th power up to the ((p-1)/3) power, mod p.
Hooley finds that:
1 < ∏p≡1 mod 3 (τ’(p)/p5) < 1.005
Using the program described above, I was able to go as far as p = 367, and we
find that:
∏p≡1 mod 3 (τ’(p)/p5) ≈ 1.67259
which is nowhere near Hooley’s conjecture at first glance. However, this is due to the
fact that the first five terms of this product contributes a large amount, and that the other
terms seem to converge within the conjectured bounds. However, despite the efficiency
of the current program, it still takes nearly three hours for p = 367.
Assuming that Hooley’s conjectured bounds are correct, we find that:
(2.01195)(1.539) < σ < (2.01195)(1.539)(1.005)
3.09 < σ < 3.11.
Using this information, we find that:
(2.01195)(1.539) < σ < (2.01195)(1.539)(1.005)
3.09 < σ < 3.11.
For now, let us assume σ = 3.09 (Hooley, p. 119). In summary, we find that:
∫M F(α)3 e(-mα) dα = A1 σ
= 1/(33) Г3(1/3) (ζ(3) (τ’(2)/25) (τ’(9)/95) ∏p≡1 mod 3 (τ’(p)/p5)
* ∏p≡2 mod 3, p≠2 (τ’(p)/p5))
≈.712 (3.09)
≈ 2.20008.
If we assume σ = 3.11, we find:
∫M F(α)3 e(-mα) dα = A1 σ
= 1/(33) Г3(1/3) (ζ(3) (τ’(2)/25) (τ’(9)/95) ∏p≡1 mod 3 (τ’(p)/p5)
* ∏p≡2 mod 3, p≠2 (τ’(p)/p5))
≈.712 (3.11)
≈ 2.21432.
If the minor arcs contribute a small amount, we can conclude that:
r3(m) = ∫M F(α)3 e(-mα) dα + ∫m F(α)3 e(-mα) dα
≈ ∫M F(α)3 e(-mα) dα
And therefore:
2.20008 < r3(m) < 2.21432.
Now, what we are really interested in is S3(x) = ∑m ≤ x r32(m). From the
information we gathered already, we come to a conjecture that says:
S3(x) ~ Bx as x → ∞
The conjecture for the universal constant B is as follows. A1σ constitutes the
contribution of the Hardy-Littlewood decomposition, that is, the major and minor arcs of
r3(m). Here, we assume that the minor arcs contribute a negligible amount, and thus the
main term is from the major arcs. 3! is added in to represent the permutations of the
solutions of x13 + x23 + x33. This is because we can permute x1, x2, and x3 3! ways to get
y1, y2, and y3. The extra A1 is multiplied in since we are looking at r32(m), not r3(m)
(Hooley, p. 147). And so we find that the universal constant B = A1 (A1σ + 3!) (Hooley,
p. 136). Thus:
S3(x) ~ A1 (A1σ + 3!)x as x → ∞.
Assuming the lower bound of σ, hence σ = 3.09, direct computation yields:
A1 = .712
A1σ = 2.20008
3! = 6.
This leads to:
S3(x) ~ A1 (A1σ + 3!)x
~ .712 (2.20008 + 6)x
~ .712 (8.20008)x
~ 5.8384x.
This means that our universal constant, B, is about 5.8384 as x → ∞. If we assume the
upper bound of σ, hence σ = 3.11, we find that:
S3(x) ~ A1 (A1σ + 3!)x
~ .712 ((.712 * 3.11) + 6)x
~ .712 (2.21432 + 6)x
~ .712 (8.21432)x
~ 5.8486x.
Thus B is somewhere between 5.8384 and 5.8486 as x → ∞. And this completes the
investigation of S3(x).
This conjecture can be expanded to find T3(x) := ∑m≤x r33(m). This number would
represent, for all integers m ≤ x, the solutions to the equation
x13 + x23 + x33 = y13 + y23 + y33 = z13 + z23 + z33.
Professor Peter Sarnak worked out that the conjectured number would be:
T3(x) ~ Cx
where the universal constant C = A12(A1σ2 + (3!)2)x, σ2 = ∏(τ2’(p)/p7)), p is a prime
number, and τ2’(p) is the number of incongruent primitive solutions to
m13 + m23 + m33 ≡ m43 + m53 + m63 ≡ m73 + m83 + m93 (mod p).
These numbers would arise as follows. First of all, (3!)2 counts the number of
permutations for a set of solutions, and since we now have x13 + x23 + x33 = y13 + y23 + y33
= z13 + z23 + z33, the number is squared. A1σ2 arises from the Hardy-Littlewood
asymptotic formula. Remember that σ2 ≠ σ because instead of five free variables, as with
the case for S3(x), there are now seven free variables, hence p7 instead of p5. A12 is the
singular integral, only that it is squared because we are looking at r33(m) instead of r32(m)
(Peter Sarnak, “Analytic Number Theory”, from his private files). Here we once again
assume that the Hardy-Littlewood solutions and the number of permutation solutions are
independent.
I was able to adjust the existing computer programs for S3(x) to calculate some
numerical values for the conjectured constant for T3(x). It would appear that this constant
approaches 59 when checked within the range of 1 to 22 million, but the data is
inconclusive so far. This is a good place for someone to continue in the research of this
special case of Waring’s Problem.
As far as calculating v3(x) goes, assuming that the value of S3(x) is correct, we
have a theorem that states that:
v3(x) > ((A1/3!) – (A12σ/(2*3!2)) + A8 – ε)x
for some positive number A8 and x sufficiently large (Hooley, p. 148-49). By direct
computation, we find:
v3(x) > ((.712/6) – ((.506944*3.09)/(72) + A8 – ε)x
v3(x) > (.119 - .0217 + A8 – ε)x
v3(x) > (.097 + η1) x
which gives a conditional lower bound for v3(x)/ x.
The upper bound, on the other hand, is not dependent on S3(x). There exists
another theorem that states that:
v3(x) < (A1/3! – A7 + ε)x
where A7 is some positive number (Hooley, p. 147). Direct computation gives us:
v3(x) < (.712/6 - A7 + ε)x
v3(x) < (.119 - A7 + ε)x
v3(x) < (.119 – η2)x.
This conjecture is also found in Francois Hennercart’s notes from his “Sums of Cubes:
Algorithmic and Numerical Aspects” seminar given in January 1997. He states that the
number of integers m which are sums of three cubes cannot exceed the number of triples
(x, y, z) subject to x3 + y3 + z3 ≤ m and 0 ≤ z ≤ y ≤ x, asymptotically equal to
1
3
6Г(4/3)
= 0.1186.
And this leads to the conjectured conclusion:
.097 + η1 < v3(x)/ x < .119 – η2 as x → ∞.
Now, for the computer programs:
The first thing I did was to see which numbers could be written as the sum of
three cubes, from say, M to M + L. So I was looking for Y(m). The point is to figure out,
for x, y, z, m ∈ ℤ+:
x3 + y3 + z3 = m, where m ∈ [M, M+L].
Let us look at this for a moment.
x3 + y3 + z3 = m
First of all, in order to reduce the workload, we may assume x ≥ y ≥ z. Y(m)
answers only whether the number m can be written as the sum of three cubes at all. It
does not matter how; that is what r3(m) does. We can end up writing things in more than
one way. For instance, for Y(m), x3 + y3 + z3 = m is the same as x3 + z3 + y3 = m and all
of its permutations. Y(m) is still only going up by 1. So, assuming x ≥ y ≥ z we just cut
the workload considerably.
For the computer program, I created an array A[t] = t*t*t. From there, three loops
are formed. The first loop is the m loop, going from the first bound, M, to the second
bound, M + L.
Then I looked at x. We can shrink the bounds of x considerably. Let us look at
our original equation:
x3 + y3 + z3 = m.
Remember that we have the inequality up above, x ≥ y ≥ z:
x3 + y3 + z3 = m
3x3 ≥ m if x = y = z
⇒
x3 ≥ m/3
⇒
x ≥ (m/3)1/3.
This is the lower bound. As for the upper bound, x, y, z ≥ 0. Hence:
x3 + y3 + z3 = m
x3 ≤ m
⇒
x ≤ m1/3.
Let us now look at the third loop, the y loop. We have the equation:
x3 + y3 + z3 = m
y3 + z3 = m - x3
Since y ≥ z, 2 y3 ≥ y3 + z3:
y3 + z3 = m - x3
2y3 = m - x3
⇒ y3 ≥ (m - x3)/2
⇒ y ≥ ((m - x3)/2)1/3.
This is the lower bound for y. As for the upper bound, clearly, y3 ≤ y3 + z3, hence:
y3 + z3 = m - x3
y3 ≤ m - x3
⇒ y ≤ (m - x3)1/3
And finally, we have the last loop, the z loop. Simplifying the equation gives us:
x3 + y3 + z3 = m
⇒
z3 = m – (x3 + y3)
Unlike the other loops, this is a fixed value. So z is not going to be looped.
Instead, what we do is ask if z = A[t] for some t? Thus we end up looping t instead. So,
if we find the A[t], then we have the equation:
m = x3 + y3 + t3
If this is possible, then Y(m) = 1. If not, Y(m) = 0.
As far as the computer program goes, these four loops are set up. At the end of
the x, y, and t loop we have an important line. It says that if z = A[t] and x ≥ y ≥ z, then
we break out of each loop. So, once we have t, increase the count of v3(x), and break out
of that loop. Also, break out of the y and the x loop. Now we start over, this time for m +
1. And we do the same thing up until we reach M + L.
For the second program of finding ∑r3(m), nearly the same thing has to be done.
We are still using loops, only this time, instead of stopping after we find a solution, we
keep going and try to find all of them. We are still going to have the inequality x ≥ y ≥ z.
Also, we are still going to loop through like we did before with the m loop, the x loop, the
y loop, and the t loop. But, now we add a few extra lines. First, we find the solution to z3
= m – (x3 + y3). If it exists, then we raise the count of r3(m). But our counter can be
incremented three different ways. If x = y = z, then there is one distinct permutation.
Thus we raise the count by 1. If x = y, x = z, or y = z, then there are three permutations,
and we raise the count by 3. If x, y, and z are unique, then there are six permutations, and
we raise the count by 6.
Unlike the v3(x) program, once we find a solution, we break out of the t loop only.
Then we increment y by one and try again. Once the program exhausts the choices of y,
we break out of that loop, increment x by one, and try again. And once it is done with all
of the values of x, only then can we check the next m. But before we start with the next
m, we reset the r3(m) counter to 0. At the end of the program, we have a line which finds
∑r3(m), ∑r32(m), and ∑r33(m). All of the data was placed into an Excel spreadsheet to
figure out the values of T3(x) and S3(x).
The conjectured values for this particular case of Waring’s problem is backed up
by the computational evidence I found. It would appear that the Hardy-Littlewood
asymptotic formula does in fact hold for s = 3 and k = 3. Between 1 to 23 million, B is
slowly increasing toward its conjectured bounds. By the time it reaches 23 million, it
reaches the value of 5.853. The values for v3(x)/x are within its conjectured bounds. That
is, .097 + η1 < v3(x)/ x < .119 – η2. It actually seemed that the value for v3(x)/x was
monotone decreasing at first, but when calculated from 1 to 10.3 million, one can see
that this is not the case. However, a look at the data shows that there is behavior similar
to that of decay. The conjectured value for C seems to be climbing up to about 59, when
checked in the range of m = 1 to m = 23,000,000.
V3(x) Program, written in C
//By Michael C. Bulboff and Jorge A. Cisneros//
//April 2001//
#include <stdio.h>
#include <math.h>
#define UPPER 1004
void main()
{
long M, L, S;
long x, y, t, m;
long a, b=0, n, d;
long z;
long counter = 0;
long xlow, xhigh, ylow, yhigh, zlow, zhigh;
long asize;
long A[UPPER];
M = 1; //Starting point//
L = 99999; //From M to M+L is the range you are studying.//
S = M + L; //upper bound//
asize = pow(S, 1.0/3.0) + 1;
// we'll only need numbers up to the cube root of S //
for(t=0; t <= asize; t++)
{
A[t]=t*t*t; //setting up the array//
}
for (m=M; m<= S; m++)
{
xlow = pow((double)(m/3), 1.0/3.0);
xhigh = pow((double)(m), 1.0/3.0);
xhigh = xhigh + 1;
//lower and upper bounds of x. xlow assumes x = y = z, and thus x = (m/3)^1/3 //
//xhigh assumes that y = z = 0, meaning that x = (m)^1/3
//
for(x=xlow; x<=xhigh; x++)
{
a = A[x];
ylow = (long) pow((m-a)/2, 1.0/3.0);
yhigh = (long) pow((m-a), 1.0/3.0);
yhigh = yhigh + 1;
//upper and lower bounds for y. Since x has a value, ylow assumes that y = z, //
//and thus y = ((m – x^3)/2)^1/3. yhigh assumes that z = 0, which means that //
//y = (m-x^3)^1/3.
//
for(y=ylow; y<=yhigh; y++)
{
b = a + A[y];
z = m - b;
for(t=0; t <= asize; t++)
{
// we now go through the array of cubes
//
// if z = A[t] for some t, we increase the //
// counter by one and break out of the loop //
if((z==A[t])&&(t<=x)&&(t<=y)&&(y<=x))
{
counter++;
break;
// this counts only if t<=y<=x //
}
if((z==A[t])&&(t<=x)&&(t<=y)&&(y<=x)) break;
} // closes the t loop. If t<=y<=x is not satisfied, then this loop does
// not break
if((z==A[t])&&(t<=x)&&(t<=y)&&(y<=x)) break;
}
// closes the y loop. Again, if t<=y<=x is not satisfied, then this
// loop does not break.
if((z==A[t])&&(t<=x)&&(t<=y)&&(y<=x)) break;
}
// closes the x loop. If z<=y<=x is not satisfied, then this
// loop does not break.
//
} // closes the m loop //
printf("counter = %d\n", counter);
}
//
//
//
//
//
//
R3(m) Program, written in C
//By Michael C. Bulboff and Jorge A. Cisneros//
//April 2000//
#include <stdio.h>
#include <math.h>
#define UPPER 1004
void main()
{
long M, L, S;
long x, y, t, m;
long a, b=0, n, d;
long z;
long count = 0, solutions = 0, counter = 0;
long total = 0, total2 = 0, total3 = 0;
long xlow, xhigh, ylow, yhigh, zlow, zhigh;
long asize;
long A[UPPER]; //setting up the array//
M = 1; //Starting point//
L = 99999; //From M to M+L is the range you are studying.//
//M and L can be changed to check different ranges.//
S = M + L; //upper bound//
asize = pow(S, 1.0/3.0) + 1;
for(t=0; t <= asize; t++)
{
A[t]=t*t*t;
}
// creates an array of cubes up to asize //
for (m=M; m<= S; m++)
{
xlow = pow((double)(m/3), 1.0/3.0);
xhigh = pow((double)(m), 1.0/3.0);
xhigh = xhigh + 1;
//lower and upper bounds of x. xlow assumes x = y = z, and thus x = (m/3)^1/3 //
//xhigh assumes that y = z = 0, meaning that x = (m)^1/3
//
for(x=xlow; x<=xhigh; x++)
{
a = A[x];
ylow = (long) pow((m-a)/2, 1.0/3.0);
yhigh = (long) pow((m-a), 1.0/3.0);
yhigh = yhigh + 1;
//upper and lower bounds for y. Since x has a value, ylow assumes that y = z, //
//and thus y = ((m – x^3)/2)^1/3. yhigh assumes that z = 0, which means that //
//y = (m-x^3)^1/3.
//
y=ylow; y<=yhigh; yigh; x++)
{
b = a + A[y];
z = m - b;
for(t=0; t <= asize; t++)
{
if((z==A[t])&&(t<=x)&&(t<=y)&&(y<=x))
{
if((x==y)&&(x==z)&&(y==z)) solutions++;
else if((x==y)||(x==z)||(y==z)) solutions+=3;
else solutions+=6;
break;
//calculating R3(m). These are the permutations.//
//If x=y=z, one distinct permutation
//
//If x=y or x=z or y=z, three permutations
//
//If x,y, and z unique, six distinct permutations //
} //closes the IF loop//
}//closes the t loop//
} //closes the y loop//
} //closes the x loop//
if(solutions!=0)
{
counter++; //mini Y(m) program//
total = total + solutions; //sum of R3(m) over [M, M+L]//
total2 = total2 + solutions*solutions; //sum of R3(m)^2//
total3 = total3 + solutions*solutions*solutions; //sum of R3(m)^3//
solutions = 0; //resetting R3(m) for the next m//
}//closes the IF loop//
} //closes the m loop//
printf("Y3(m) Total = %d\n", counter);
printf("R3(m) Total = %d\n", total);
printf("R3(m) Squared Total = %d\n", total2);
printf("R3(m) Cubed Total = %d\n", total3);
}
Singular Series Program, written in C
#include <stdio.h>
#include <math.h>
/* By Jorge Cisneros and Steven J. Miller, May 2001 */
/* This program is for p congruent 1 mod 3 */
void main()
{
long a3, b3, c3, d3, e3, f3;
double counter=0, counter3=0;
double p5;
long z, q;
int x,y,i,j,num,root, root3;
int p, pp, q3, z3;
int fact[7];
int a[7], n[14];
int va[202];
p = 137; //prime being investigated//
pp = (p-1) / 3; //prime – 1 divided by 3, since we are checking only up to g^1/3//
root = 3; //primitive root of p //
root3 = root*root*root % p; //cube of primitive root mod p//
va[0] = 0; va[1] = (root*root*root) % p; //initializing loop//
for (x = 2; x <= pp; ++x)
{
va[x] = va[x-1]*root3 % p;
// creating an array with the primitive roots up to the power (p-1)/3 //
}
for (x = 0; x <= pp; ++x) printf("x = %d, x^3 = %d\n", x, va[x]);
/* a[] is an array of six values, a[1], ..., a[6] */
/* these are our 6 loop variables. */
/* to dramatically increase runtime, we notice:
/* (1) instead of studying a^3 + b^3 + c^3 - (d^3 + e^3 + f^3) study a^3 + ... + f^3,
/* because –d and d run through the same numbers
/* (2) without a loss of generality, we can let a >= b >= c >= d >= e >= f, and then
/* count permutations.
/* a = a[1], b = a[2], …
for (a[1]=0; a[1]<= pp; a[1]++)
*/
*/
*/
*/
*/
*/
{ a3 = va[a[1]];
for (a[2]=0; a[2]<=a[1]; a[2]++)
{ b3 = va[a[2]];
for (a[3]=0; a[3]<=a[2]; a[3]++)
{ c3= va[a[3]];
for (a[4]=0; a[4]<=a[3]; a[4]++)
{ d3 = va[a[4]];
for (a[5]=0; a[5]<=a[4]; a[5]++)
{ e3 = va[a[5]];
for (a[6]=0; a[6]<=a[5]; a[6]++)
{ f3 = va[a[6]] ;
z3 = a3 + b3 + c3 + d3 + e3 + f3;
q3 = z3 % p;
for (x = 1; x <= 6; ++x) n[x] = 1;
i = 2;
while (a[i] == a[1]) { n[1]++; i++;}
j = i+1;
while (a[j] == a[i]) { n[i]++; j++;}
i = j+1;
while (a[i] == a[j]) { n[j]++; i++;}
j = i+1;
while (a[j] == a[i]) { n[i]++; j++;}
i = j+1;
while (a[i] == a[j]) { n[j]++; i++;}
j = i+1;
while (a[j] == a[i]) { n[i]++; j++;}
num = 720 / (fact[n[1]]*fact[n[2]]*fact[n[3]]*
fact[n[4]]*fact[n[5]]*fact[n[6]]);
for (j = 1; j <= 6; ++j)
{
if (a[j] != 0) num = num*3;
}
/* the above figures out how many permutations */
/* we can have. */
//printf("a = %d\n", f3);//
//printf("z = %d\n", z);//
//printf("q = %d\n", q);//
if (q3==0) counter3 = counter3 + num;
}
}
}
}
}
}
printf("cube counter = %lf\n", counter3);
}
REFERENCES
“Analytic Number Theory.” From the private files of Professor Peter Sarnak (2001).
Borevich, Z. I. and I. R. Shafarevich. Number Theory. New York: Academic Press.
pp. 1 – 21.
Heath-Brown, D. R. “The circle method and diagonal cubic forms.” Phil. Trans. R.
Soc. Lond. A (1998), 356, 673 699. The Royal Society.
Hennecart, Francois. “Sums of Cubes: Algorithmic and Numerical Aspects.” From an
“Algorithms Seminar” given in A2X, Université Bordeaux 1. 13 January 1997.
Hooley, Christopher. “On some topics connected with Waring’s problem.” Journal fur
die Reine und Angewandte Mathematik de Gruyter. 367 - 369 (1986), pp. 110 - 153.
Nathanson, Melvyn B. Additive Number Theory: The Classical Bases (Graduate Texts
In Mathematics, Vol 164).
“Number Theory.” From the private files of Assistant Professor Jordan Ellenberg (2001).
SPECIAL THANKS
Special thanks go out to the following people. Thank you all for your countless hours of
love and support.
People behind the scenes that helped with programming, mathematics, and moral
support:
Steven Joel Miller
Michael C. Bulboff
Prof. Peter Sarnak
Asst. Prof. Jordan Ellenberg
Andrew Lookingbill
Gregory Larkin
Supporting cast, those who were with me in spirit:
Javier Andrés Colón Volgamore
Christine Barrett
Lynn Greenberg
Victor Cisneros, Sr.
Joe Facchini
Jamie Coughlin
Avik Mukhopadhyay
Damian Petrone
Craig Langrall
Marsha Van Dalen
Julio Davila
Andy Hultgren
Anesu “Stud” Mandisodza
John Guevara
Amanda Plata
Aime Scott
Brigitte Anderson
Skye Flusser
Natalie Ram
Julie Comerford