08 0412
08 0412
08 0412
Sam Northshield
Introduction.
(1)
sequence (see [3] for example). The latter name comes from the following array
of numbers, called Sterns diatomic array:
1
1
1
1
1 5
. .
4
4 7
. .
3
3
3
.
5
8 5
. .
2
2
2
7 2
. .
3
3
8 3
. .
5
7 5
. .
4
7 4
. .
1
1
1
1
5 1
. .
This is similar to Pascals triangle in that every entry in all but the top row is
the sum of certain entries above. Specifically, given the nth row, we get the next
row by repeating the nth row but, between each two entries, we put the sum
of those entries. Any entry which is at the top of a column is the sum of two
entries on the previous row while any other entry just repeats the entry directly
above it. All entries not in the first or last column contribute to three below and
receive from either one or two above, so that the valence (here meaning the
number of bonds made with other entries) is 4 or 5. Hence, the term diatomic:
conceivably an alloy with two types of atoms, of chemical valence 4 and 5 (e.g.,
carbon and gold), could combine to make a kind of crystal described by the
diatomic array (see Figure 3 in Section 7). Of course, such a crystal could only
exist in hyperbolic space since row size increases exponentially.
We observe that the nth row of the diatomic array contains 2n1 +1 elements
while the sum of the elements in the nth row is 3n1 + 1. The diatomic array
can be written symbolically in terms of {an }:
a1
a2
a4
a8
a9
a5
a10
a11
a3
a6
a12
a13
a7
a14
a15
a2
a4
a8
a16
Each row of the diatomic array is palindromic and we may express this
symmetry as a formula: for all n and all k 2n ,
a2n +k = a2n+1 k .
(2)
(3)
n
n
5)n (1 5)n
=
,
(4)
2n 5
where
is the golden ratio (1 + 5)/2 and is its algebraic conjugate (1
5)/2.
Notice that the right column of the diatomic array matches the left. Removal
of the right column and squeezing everything to the left yields the crushed
array:
1
1 2
1 3 2 3
1 4 3 5 2 5 3 4
1 5 4 7 3 8 5 7 2 ...
Fn =
(1 +
and ak+1 . One of k and k + 1 is even and so appears in a previous row, and
therefore
Mn+1 Mn + Mn1 .
Since M1 = 1 = F2 and M2 = 2 = F3 , by induction, Mn Fn+1 .
Jacobsthals sequence is given by a Binet-type formula:
J(n) := Jn =
2n (1)n
,
3
This result, and more, goes back to a paper by Lind [23], who gives a formula
for the locations of both Fibonacci numbers and Lucas numbers in the diatomic
array. Several of these results have been ascribed to Tokita by Sloane [27,
sequence A002487].
an+1 xn .
n=0
a2n+1 x2n +
n=0
n=0
n=0
n=0
2
We have seen that the maximum of the nth row of the diatomic array is the
(n + 1)st Fibonacci number. The numbers an are, in several surprising ways,
analogues of the Fibonacci numbers.
Consider Pascals triangle:
1
1
1
1
1
3
4
3
6
1
4
which is composed of binomial coefficients nk := n!/(k!(n k)!). The Fibonacci
numbers appear as diagonal sums across Pascals triangle. For example, the sum
along the boxed numbers is 5 = F5 and, in general,
X i + j
X n i
= Fn+1 .
(5)
=
i
i
2i+j=n
i
In general, we let a mod b denote the remainder of a upon division by b or,
equivalently, a mod b := a ba/b.
5
n
k
is replaced by
1
1
1
1
1
0
1
0
1
1
1
0
The diatomic sequence appears as diagonal sums over Pascals triangle mod
2. For example, the boxed entries sum to 3 = a5 and, in general, we get the
following result.
Theorem 4.1.
X i + j
mod 2 = an+1 .
i
2i+j=n
(6)
We can prove this theorem using Kummers theorem of 1852 (see [21] or [15,
exercise 5.36]):
Lemma 4.2. Let p be a prime number. The largest k such that pk divides i+j
i
is the number of carries when adding i and j base p.
For example, in base 3, 13 = 1113 and 5 = 123 , and adding them together
requires 2 carries.
By the lemma, 9 should be the largest power of 3 which
divides 13+5
=
8568,
which is easily verified.
5
Proof of Theorem 4.1. Lemma 4.2 implies that i+j
mod 2 is 1 if and only if
i
adding i and j base 2 requires no carries or, saying that another way, i and j
share no 1s in the same locations in their base-2 expansions. The left side of (6)
then counts the number of ways to write n as a sum 2i + j where i and j share
no 1s in the same locations in their base-2 expansions, which is the number of
hyperbinary expansions of n.
Most proofs of Fibonacci identities (of which there are hundreds!see the
books by Koshy [20] and Vajda [30] for example) use or can use one of two basic
tools: the Binet formula and the recurrence formula. We find analogues of these
for the diatomic sequence.
Proposition 4.3. Sterns diatomic sequence satisfies
an+1 = an + an1 2(an1 mod an ).
(7)
Therefore (7) holds for 2n + 1. Also, a2n1 mod a2n = (an + an1 ) mod an =
an1 mod an . Thus
a2n+1 = an + an+1 = an + (an + an1 2(an1 mod an )
= a2n + a2n1 2(a2n1 mod a2n )
and so (7) holds for 2n.
We remark that just as (5) can be proven using the recurrence formula for
Fibonacci numbers, one can prove Theorem 4.1 by using Proposition 4.3.
Binets formula (4), a workhorse in the theory of Fibonacci and Lucas numbers, can be rewritten as
n
X
nk
Fn+1 =
k
.
(8)
k=0
Proposition 4.4. Let s2 (k) denote the number of 1s in the binary expansion
of k and let , := ei/3 be the primitive sixth roots of unity. Then
an+1 =
n
X
s2 (k) s2 (nk) .
(9)
k=0
Proof. We show that the generating functions of both sides agree. Note that
s2 (k), the number of 1s in the binary expansion of k, obviously satisfies and
can be in fact defined by
= s2 (k)
s2 (2k)
s2 (2k + 1) = s2 (k) + 1
s0
= 0.
Let := ei/3 and, for real x, let
B(x) :=
s2 (k) xk .
k=0
k=0
k=0
s2 (2k) x2k +
s2 (2k+1) x2k+1
k=0
s2 (k) x2k + x
k=0
an+1 x =
n=0
k=0
n=0
s2 (k) k
n
X
k=0
k=0
s2 (k) s2 (nk)
s2 (k) k
xn .
The sequence {s2 (k)} has been well studied; see [27, sequence A000120] and
references therein. The sequence {2s2 (k) }, also known as Goulds sequence, also
is well studied (see [27, sequence A001316])it is the number of 1s in the kth
row of Pascals triangle modulo 2. General sums across Pascals triangle modulo
2, specifically
X i + j
xn :=
mod 2 ,
i
ai+bj=n
n
X
k=0
( s2 (k)s2 (nk) ) =
n
X
k=0
Finally, since
1
(1)n (3 1(3) (n) 1),
2
where 1(3) (n) is 1 if n is a multiple of 3 and 0 otherwise, we find
( n ) =
an+1 =
1X
(1)s2 (k)s2 (nk) [3 1(3) (s2 (k) s2 (n k)) 1].
2
k=0
1
Fn
= .
n
an
log
2 (n)
8
=1
(10)
(though there is no particular evidence that this should be true and numerical
evidence suggests that it is not). To put this into context, Calkin and Wilf, in
an unpublished note (referred to in [11]), show that the left side of (10) satisfies
.9588 < L < 1.1709. By Theorem 4.1, an is a diagonal sum across Pascals
triangle mod 2. Summing along rows instead gives, as we saw before, 2s2 (n) . It
is easy to see (we leave it as an exercise) that
lim sup
n
2s2 (n)
= 1.
2log2 (n)
S(n)
= 1.
3log2 (n)
Everyone knows that the rational numbers are countable (that is, are in oneto-one correspondence with Z+ , the set of positive integers) but few actually
know of an explicit such correspondence. The diatomic sequence gives one.
Specifically,
an+1
1 1 2 1 3 2 3 1 4
, ...
, , , , , , , , , ...,
1 2 1 3 2 3 1 4 3
an
is exactly the set of positive rational numbers (and no number appears twice).
We state this as a theorem; our proof (which we present for completeness) is
new but cant beat the one by Calkin and Wilf as presented in their charming
paper [5].
Theorem 5.1. The map
n 7
an
an+1
Let Ln := [an , an+1 ]. By (1), its easy to see that for n > 1,
SEA : L2n , L2n+1 7 Ln
and, moreover, if SEA : [a, b] 7 Ln then either [a, b] = L2n or [a, b] = L2n+1 .
Since L1 = [1, 1], every Ln is a relatively prime pair.
If there is relatively prime pair [a, b] not in L, then all of its successors under
the SEA, including [1, 1], are not in La contradiction. Hence, every relatively
prime pair appears in L.
The pair [1, 1] appears only once in L. In general, no relatively prime pair
appears more than once in L for, otherwise, there exists a smallest n > 1 such
that Ln = Lm for some m > n. Applying one step of the SEA to both Ln and
Lm forces n/2 = m/2 and therefore m = n + 1. Thus an = an+1 = an+2 , a
contradiction.
It is clear that the map n 7 an /an+1 can be efficiently computed (i.e.,
computed in polynomial time in the number of digits of n) but, unfortunately,
the same is not true of the inverse, since the first k where (ak , ak+1 ) = (1, n) is
when k = 2n1 . So we cant even write this down in polynomial time (n has
log n bits but the first position of 1/n has roughly n bits.) For a solution that
does run in polynomial time in both directions, see [26].
Equation (7) leads to Theorem 5.2, a fact noted by several authors (e.g.,
Newman and Somos, in [27, sequence A002487]). Let {x} denote the fractional
part of x.
Theorem 5.2. The iterates of 1 + 1/x 2{1/x} (equivalently, the iterates of
1 + 21/x 1/x), starting at 1, span the entire set of positive rational numbers.
Proof. Let rn := an+1 /an . Then we may rewrite (7) as
1
1
rn+1 = 1 +
2
rn
rn
and the result follows.
We conclude with two interesting formulas.
Theorem 5.3. For t > 1,
X
m odd
Also,
1
t
.
=
tam 1
(t 1)2
2
= 1.
2
a
a
a
n=1 2n 2n+1 2n+2
Proof. For a rational number r, let (r) be the denominator of r when expressed
in lowest terms or, equivalently,
(r) := min{k N : kr Z}.
10
t(r) 1
0<r<1
=
=
X X
tk(r) =
0<r<1 k=1
X
X
j
n
n=1
X
X
tj
n=1 j>n
j=1
1
.
(t 1)2
Note that for every positive integer j, aj < aj+1 if and only if j is even. Hence
every rational number strictly between 0 and 1 is of the form a2m /a2m+1 =
am /a2m+1 for a unique m 1, and we see that
m=1
1
ta2m+1
1
.
(t 1)2
a a2
a
n=1 2n 2n+1 2n+2
=2
n,k1,nk
1
nk(n + k)2
2
(m
k)km2
m=2 k<m,km
X
X 1
2
1
=
+
m3
k mk
m=2
k<m,km
4
m3
m=2
k<m,km
1
.
k
As noted by Baney et al. [2, Theorem 7], the mth summand on the right is the
probability that m is the lowest possible denominator of any fraction between
the two coordinates of a point P chosen uniformly at random from the unit
square. Hence the total sum is 1.
Minkowskis ? Function
Recall the notation for continued fractions (see, for example, Hardy and Wright
[18]): for positive integers c1 , c2 , c3 , . . . ,
[0; c1 , c2 , c3 , . . . ] := 1/(c1 + 1/(c2 + 1/(c3 + ))).
11
0
0
X
k
(1)k1
2c1 ++ck 1
(11)
One of the question mark functions most interesting properties is that it maps
quadratic surds to rational numbers (since the sequence c1 , c2 , ... is eventually
periodic precisely when x is a quadratic surd). Several nice references exist; see
especially the thesis of Conley [8]. The results of this section are surely known; I
have seen hints in internet references to a talk by Reznick and a note by Conway
but am unable to give a specific reference.
Let D denote the set {k/2n : k, n Z+ , k 2n } of positive dyadic rationals
in the unit interval and consider the function f : D Q defined by
f (k/2n ) :=
ak
.
a2n +k
a2k
ak
=
= f (k/2n ).
a2n+1 +2k
a2n +k
Theorem 6.1. The function f extends to a strictly increasing continuous function from the unit interval to itself.
Proof. Consider the matrices
am+1
M (m, n) :=
am
12
an+1
an
and define
A0 := M (0, 1) =
1
0
1
1 0
, A1 :=
.
1
1 1
n
X
k=0
(12)
(13)
Next, note that every odd entry (i.e., entry of odd index) in the nth row of
the diatomic array is the sum of two consecutive entries in the previous row and
so is at least one more than an odd entry of the previous row. It follows that
for all n and k < 2n ,
a2n +k a2n +k+1 n + 1.
(14)
Using (13) and (14), we see that
ak+1
a
2n +k+1
ak
a
2n +k
and so
0<
a2n +k+1
a2n +k
n+1
It is then enough to show that (15) holds for dyadic rationals x := k/2m .
By (2) and (3),
a2m+1 +2m+1 k = a2m+2 k = a2m+1 +k = ak + a2m+1 k
and
a2m+n+1 +2m+1 k = a2m+n +2m+1 k + a2m+1 k .
Therefore, by induction,
a2m+n +2m+1 k = ak + na2m+1 k = ak + na2m +k .
Then
f
2 k/2m
2n
a2m+1 k
2m+1 k
=
m+n
2
a2m+n +2m+1 k
a2m +k
1
=
=
.
m
ak + na2 +k
n + f (k/2m )
=f
n
X
ik 2k then m =
k=0
n
X
ink 2k .
k=0
As t decreases towards 0, N grows, and although t may also grow, it is conjectured that it grows no faster than 1/t1/4 . More precisely, it is conjectured
15
lim+ t 4 + t = 0.
t0
A Geometric View
Let Sm,n be an infinite graph which is the boundary of a tiling of a quarterplane by 2n-gons so that every vertex has m edges emanating downwards. For
example, Figures 3 and 4 show S3,2 and S2,3 respectively. S2,2 is just one quarter
of an infinite square grid. S2,2 is a geometric representation of Pascals triangle;
assign to each vertex the corresponding number in Pascals triangle and note
that the number assigned to each vertex is the sum of all numbers in neighbors
above. By induction, the number assigned to each vertex v is the number of
downward paths starting at the top vertex and ending at v.
Figure 3 shows an infinite graph closely related to Sterns sequence. We call
16
1
1 2
1
1
1
2
3 2
1
1
1
3 1
2
3 2
1
1
3 1
1
2 1
and its not hard to see that Sterns sequence features in it: the (n 1)st row is
a1 , a2 , ..., a2n 1 , a2n , a2n 1 , ..., a2 , a1 .
Now consider a random walk starting at the top vertex and always going
downwards, choosing one of its three edges at random. If we identify the bottom
of S3,2 with the unit interval, then the random walk has a limiting distribution
on the unit interval. For example, lets compute the chance that the random
walk is eventually in the interval [1/4, 3/8] (we call this quantity ([1/4, 3/8])).
The only way the random walk can end up in this interval is if, at the second
step, it is at the second or third vertex of the third row. There are a2 = 1 and
a3 = 2 ways to end up at these vertices respectively. However, given it is at the
second vertex or third vertex, only half of the time will it end up in [1/4, 3/8],
and so the desired probability is 12 (a2 + a3 )/32 = a5 /18 = 1/6. In general,
a2j+1
k k+1
=
,
,
n
n
2
2
2 3n1
where j = k or 2n 1 k according to whether k is less than 2n1 or not.
Let M be the (infinite) matrix defined by M (i, j) = 1 if j {2i1, 2i, 2i+1},
0 otherwise (i, j = 1, 2, 3, ...). This is the adjacency matrix of a graph with
vertices labelled by the positive integers. The powers of M have a limit:
M (i, j) := lim M n (i, j)
n
17
2
3
3
3
.
3
3
.
2
2
2
5 2
. .
4
4
.
2
2
2
4 2
. .
3
3
5 3
. .
3
3
.
1
1
1
1
1
4 1
. .
This array is contained in S2,3 in the same way that Sterns diatomic array is
contained in S3,2 .
If N (i, j) = 1 if j {i, i} and 0 otherwise, then N is the adjacency
matrix of a graph and
bn := lim N n (1, n).
n
The Fibonacci diatomic sequence (bn ) has a counting interpretation: bn+1 is the
number of ways that n can be written as a sum of distinct Fibonacci numbers.
Future Directions.
Thus ends a tour of this splendid sequence. The references belowand their
referencescontain more and the reader is encouraged to delve further. Here
are some directions of future research.
18
References
[1] J-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoret. Comput. Sci. 98 (1992) 163197.
[2] D. Baney, S. Beslin, and V. DeAngelis, Farey tree and distribution of small
denominators, in Topology Proc. 22 (1997) 23-37.
[3] M. Bicknell-Johnson, Stern diatomic array applied to Fibonacci representations, Fibonacci Quart. 41 (2003) 169-180.
19
[4]
[5] N. Calkin and H. S. Wilf, Recounting the rationals, this Monthly 107
(2000) 360-367.
[6] L. Carlitz, A problem in partitions related to the Stirling numbers, Bull.
Amer. Math. Soc. 70 (1964) 275-278.
[7] R. M. Conley, A Survey of the Minkowski ?(x) Function, M.S. thesis, West
Virginia University, Morgantown, WV, 2003.
[8] J. H. Conway, On Numbers and Games, Academic Press, New York, 1976.
[9] E. W. Dijkstra, Selected Writings on Computing: A Personal Perspective,
Springer-Verlag, New York, 1982.
[10] H. M. Edwards, Riemanns Zeta Function, Pure and Applied Mathematics,
vol. 58, Academic Press, New York, 1974.
[11] S. R. Finch, Mathematical Constants, Encylopedia of Mathematics and its
Applications, vol. 94, Cambridge University Press, Cambridge, 2003.
[12] C. Giuli and R. Giuli, A primer on Sterns diatomic sequence I, Fibonacci
Quart. 17 (1979) 103-108.
[13]
[14]
[21] E. E. Kummer, Uber
die Erg
anzungssatze zu den allgemeinen Reciprocit
atsgesetzen, J. Reine Angew. Math. 44 (1852) 93-146.
[22] D. H. Lehmer, On Sterns diatomic sequence, this Monthly 36 (1929)
59-67.
[23] D. A. Lind, An extension of Sterns diatomic series, Duke Math. J. 36
(1969) 55-60.
[24] S. Northshield, Sums across Pascals triangle modulo 2 (to appear).
[25] J. Paradis, P. Viader, and L. Bibiloni, The derivative of Minkowskis ?(x)
Function, J. Math. Anal. Appl. 253 (2001) 107-125.
[26] J. Shallit, Formal languages and number theory, in Unusual Applications
of Number Theory, Proc. DIMACS Workshop, Rutgers, 2000, American
Mathematical Society, Providence, RI, 2004, 169-181.
[27] N. J. A. Sloane, The On-Line Encyclopedia of Integer Sequences, available
at http://www.research.att.com/~njas/sequences/.
21