Sequences of Generalized Happy Numbers with Small Bases

H. G. Grundman Department of Mathematics Bryn Mawr College Bryn Mawr, PA 19010 USA

                     grundman@brynmawr.edu

E. A. Teeple Department of Biostatistics University of Washington Seattle, WA 98195 USA

                   eteeple@u.washington.edu

Abstract For bases b ≤ 5 and exponents e ≥ 2, there exist arbitrarily long finite sequences of d-consecutive e-power b-happy numbers for a specific d = d(e, b), which is shown to be minimal possible.

1 Introduction

A positive integer a is a happy number if taking the sum of the squares of its digits and repeating the process iteratively leads to the number one. (See \underline{A000108} in [7].) Generalizations of happy numbers, suggested by Richard Guy [6], have been formalized and studied by the present authors [2, 3, 4, 5].

Define S_{e,b} : ℤ^{+} → ℤ^{+}, for e ≥ 2, b ≥ 2, and 0 ≤ a_{i} ≤ b − 1, by

S_{e,b} (∑_{i=0}^{n} a_{i}b^{i}) = ∑_{i=0}^{n} a_{i}^{e}.

If S_{e,b}^{m}(a) = 1 for some m ≥ 0, we say that a is an e-power b-happy number.

Guy [6] asked for the maximal lengths of strings of consecutive happy numbers. El-Sedy and Siksek [1] showed that there exist arbitrarily long finite sequences of consecutive happy numbers (i.e., 2-power 10-happy numbers). The present authors proved more general results for sequences of consecutive e-power b-happy numbers for e = 2 and 3 [3] and for e = 5 [2]. To describe the relevant results, we need an additional definition.

For d ∈ ℤ^{+}, define a d-consecutive sequence to be an arithmetic sequence with constant difference d. In many cases, it is straight-forward to prove that for fixed values of e and b, all e-power b-happy numbers are congruent to some fixed value modulo d. So the most that can be hoped for is a d-consecutive sequence of these numbers.

Specifically, we have that for any b, letting d = gcd(2, b − 1), there exist arbitrarily long finite d-consecutive sequences of 2-power b-happy numbers [3]. For 2 ≤ b ≤ 13 and d = gcd(6, b − 1), there exist arbitrarily long finite d-consecutive sequences of 3-power bhappy numbers [3]. And, for 2 ≤ b ≤ 10 and d = gcd(30, b − 1), there exist arbitrarily long finite sequences of d-consecutive 5-power b-happy numbers [2]. In each of these cases, d is known to be as small as possible.

In this paper, we consider conditions for the existence of sequences of e-power b-happy numbers where, instead of fixing the exponent, we fix the base. Restricting to values of b ≤ 5, we present new results that hold for all exponents e. In the following section, we present key technical definitions and the main results of the paper. In the final section, we prove these results.

2 Main Results

In this section we study the existence of sequences of consecutive e-power b-happy numbers with b ≤ 5.

First note that for each e ≥ 2, every positive integer is e-power 2-happy. Hence, trivially, there exist arbitrarily long sequences of consecutive e-power 2-happy numbers. We now consider bases 3, 4, and 5.

The following lemma and corollary provide that for bases 3 and 5, the best we can achieve is 2-consecutive sequences and for base 4 with odd power, 3-consecutive sequences. The proofs are straight-forward.

Lemma 2.1. Let e ≥ 2. For any m ∈ ℤ^{+},

S_{e,3}^{m}(x) ≡ x (mod 2) and S_{e,5}^{m}(x) ≡ x (mod 2).

Further, for e odd,

S_{e,4}^{m}(x) ≡ x (mod 3).

Corollary 2.1. For e ≥ 2, all e-power 3-happy numbers are congruent to 1 modulo 2 and all e-power 5-happy numbers are congruent to 1 modulo 2. For odd e ≥ 2, all e-power 4-happy numbers are congruent to 1 modulo 3.

We now recall some needed definitions and two lemmas proved previously [3]. Fix e ≥ 2 and b ≥ 2. Let U_{e,b} denote the union of all cycles (including fixed points) of the function S_{e,b},

U_{e,b} = {a ∈ ℤ^{+}| for some m ∈ ℤ^{+}, S_{e,b}^{m}(a) = a}.

A finite set T is (e, b)-good if, for each u ∈ U_{e,b}, there exist n, k ∈ ℤ^{+} such that for all t ∈ T, S_{e,b}^{k}(t + n) = u.

Lemma 2.2. Fix e, b ≥ 2. If T = {t} ⊆ ℤ^{+}, then T is (e, b)-good.

Let I : ℤ^{+} → ℤ^{+} be defined by I(t) = t + 1.

Lemma 2.3. Fix e, b ≥ 2. Let F : ℤ^{+} → ℤ^{+} be the composition of a finite sequence of the functions S_{e,b} and I. If F (T) is (e, b)-good, then T is (e, b)-good.

We can now state our main results including giving necessary and sufficient conditions for the existence of arbitrarily long finite sequences of e-power b-happy numbers, for b = 3, 4, or 5. We prove these results in Section 3 using methods generalizing those used in earlier works [2, 3].

First we have that, without any restriction on e, there exist arbitrarily long finite sequences of 2-consecutive e-power 3-happy numbers.

Theorem 2.1. Let T be a finite set of positive integers. Given any e ≥ 2, T is (e, 3)-good if and only if the elements of T are congruent modulo 2.

Corollary 2.2. For each e ≥ 2, there exist arbitrarily long finite sequences of 2-consecutive e-power 3-happy numbers.

For base 4, there exist arbitrarily long finite sequences of d-consecutive e-power 4-happy numbers, where d depends on the parity of e.

Theorem 2.2. Let T be a finite set of positive integers, and let e ≥ 2. For e even, T is (e, 4)-good. For e odd, T is (e, 4)-good if and only if the elements of T are congruent modulo 3.

Corollary 2.3. For each even e ≥ 2, there exist arbitrarily long finite sequences of e-power 4-happy numbers.

For each odd e ≥ 2, there exist arbitrarily long finite sequences of 3-consecutive e-power 4-happy numbers.

And finally, for base 5, we have that, independent of the value of e, there exist arbitrarily long finite sequences of 2-consecutive e-power 5-happy numbers.

Theorem 2.3. Let T be a finite set of positive integers. Given any e ≥ 2, T is (e, 5)-good if and only if the elements of T are congruent modulo 2.

Corollary 2.4. For each e ≥ 2, there exist arbitrarily long finite sequences of 2-consecutive e-power 5-happy numbers.

3 Proofs of Main Theorems

In this section we prove Theorems 2.1, 2.2, and 2.3.

Proof of Theorem 2.1. If T is (e, 3)-good, then it follows from Lemma 2.1 that the elements of T are congruent modulo 2.

For the converse, let T be a finite set of positive integers all of which are congruent modulo 2. If T is empty, then vacuously it is (e, 3)-good and if T has exactly one element, then, by Lemma 2.2, T is (e, 3)-good.

Fix N > 1 and assume that any set of fewer than N elements all of which are congruent modulo 2 is (e, 3)-good. Suppose T has exactly N elements and let t_{1} > t_{2} ∈ T.

Let v = \frac{t_{1}−t_{2}}{2} . Since t_{1} ≡ t_{2} (mod 2), v ∈ ℤ. Fix r ∈ ℤ^{+} so that 3^{r} > 3t_{1} and let m = 3^{r} + v − t_{2} > 0. Then

I^{m}(t_{1}) = t_{1} + 3^{r} + v − t_{2} = 3^{r} + 3v

and

I^{m}(t_{2}) = t_{2} + 3^{r} + v − t_{2} = 3^{r} + v.

Since 3^{r} > 3v, it follows that I^{m}(t_{1}) and I^{m}(t_{2}) have the same non-zero digits in base 3. Hence, S_{e,3}I^{m}(t_{1}) = S_{e,3}I^{m}(t_{2}). Thus the number of elements in S_{e,3}(I^{m}(T)) is less than the number of elements in T. Since the elements of S_{e,3}(I^{m}(T)) are all congruent modulo 2, by assumption, S_{e,3}(I^{m}(T)) is (e,3)-good. Hence, by Lemma 2.3, T is (e,3)-good, as desired.

Now we turn to the base 4 case.

Proof of Theorem 2.2. If e is odd and T is (e, 4)-good, then it follows from Lemma 2.1 that the elements of T are congruent modulo 3.

For the converse, let T be a finite set of positive integers and if e is odd, assume that all of the elements of T are congruent modulo 3. As in the proof of Theorem 2.1, if T is empty or has exactly one element, it is (e, 4)-good. Fix N > 1. If e is even, assume that any set of fewer than N elements is (e, 4)-good and if e is odd, assume that any set of fewer than N elements all of which are congruent modulo 3 is (e, 4)-good. Suppose T has exactly N elements. To complete the proof, it suffices to prove that there exists a function F as in Lemma 2.3 such that for some t_{1} > t_{2} ∈ T, F (t_{1}) = F (t_{2}).

Suppose that e is even and let t_{1} > t_{2} ∈ T. We will show that there exists an n ∈ ℤ^{+} such that S_{e,4}I^{n}(t_{1}) ≡ S_{e,4}I^{n}(t_{2}) (mod 3). Let g : {0, 1, 2} → {0, 1, 2} be defined by g(x) ≡ x^{e} −(x+1)^{e} (mod 3) and notice that since e is even, g is surjective. Choose c ∈ {0, 1, 2} such that g(c) ≡ S_{e,4}(t_{1} − t_{2} − 1) (mod 3). (If t_{1} − t_{2} − 1 = 0, choose c so that g(c) ≡ 0 (mod 3).) Fix s ∈ ℤ^{+} so that 4^{s−1} > t_{1} and let n = (c + 1)4^{s} − t_{2} − 1. Then

I^{n}(t_{2}) = (c + 1)4^{s} − 1 = c4^{s} + ∑_{i=0}^{s−1} 3 · 4^{i}

and so S_{e,4}I^{n}(t_{2}) ≡ c^{e} (mod 3). On the other hand,

I^{n}(t_{1}) = (c + 1)4^{s} + t_{1} − t_{2} − 1

and so S_{e,4}I^{n}(t_{1}) ≡ (c + 1)^{e} + S_{e,4}(t_{1} − t_{2} − 1) ≡ c^{e} ≡ S_{e,4}I^{n}(t_{2}) (mod 3). By Lemma 2.3, to prove that T is (e, 4)-good, it suffices to prove that S_{e,4}I^{n}(T) is (e, 4)-good. Hence we may assume without loss of generality that T contains t_{1} > t_{2} ∈ T with t_{1} ≡ t_{2} (mod 3).

So now letting e be any value (even or odd), let t_{1} > t_{2} ∈ T with t_{1} ≡ t_{2} (mod 3). (By assumption, this is always the case if e is odd.) Then, paralleling the proof of 2.1, let v = \frac{t_{1}−t_{2}}{3} ∈ ℤ. Fix r ∈ ℤ^{+} so that 4^{r} > 4t_{1} and let m = 4^{r} +v−t_{2} > 0. Then I^{m}(t_{1}) = 4^{r} +4v and I^{m}(t_{2}) = 4^{r} + v. It follows that I^{m}(t_{1}) and I^{m}(t_{2}) have the same non-zero digits and so S_{e,4}I^{m}(t_{1}) = S_{e,4}I^{m}(t_{2}).

Finally, for the base 5 case, the proof is essentially the same, so we indicate only the primary steps.

Proof of Theorem 2.3. It is easy to see that if T is (e, 5)-good, then the elements of T are congruent modulo 2.

Again, using induction, let T have exactly N elements, all of which are congruent modulo 2. Let t_{1} > t_{2} ∈ T.

First suppose that u = t_{1} −t_{2} ≡ 2 (mod 4). Let g : {0, 1, 2, 3} → {0, 1, 2, 3} be defined by g(x) ≡ x^{e} − (x + 1)^{e} (mod 4) and note that g(0) = −1 and g(1) = 1. Choose c ∈ {0, 1, 2, 3} such that g(c) ≡ S_{e,5}(u−1) (mod 4). Fix s ∈ ℤ^{+} so that 5^{s−1} > t_{1} and let n = (c+1)5^{s}−t_{2}−1. Then S_{e,5}I^{n}(t_{2}) ≡ c^{e} (mod 4) and S_{e,5}I^{n}(t_{1}) ≡ (c + 1)^{e} + S_{e,5}(u − 1) ≡ S_{e,5}I^{n}(t_{2}) (mod 4). Hence we may assume without loss of generality that T contains t_{1} > t_{2} ∈ T with t_{1} ≡ t_{2} (mod 4).

Assuming, then that t_{1} ≡ t_{2} (mod 4), let v = \frac{t_{1}−t_{2}}{4} ∈ ℤ. Fix r ∈ ℤ^{+} so that 5^{r} > 5t_{1} and let m = 5^{r} + v − t_{2} > 0. Then I^{m}(t_{1}) = 5^{r} + 5v and I^{m}(t_{2}) = 5^{r} + v, implying that they have the same non-zero digits. Hence S_{e,5}I^{m}(t_{1}) = S_{e,5}I^{m}(t_{2}), as desired.

References

[1] E. El-Sedy and S. Siksek, On happy numbers, Rocky Mountain J. Math., 30 (2000), 565–570.

[2] H. G. Grundman and E. A. Teeple, Iterated sums of fifth powers of digits, Rocky Mountain J. Math., to appear.

[3] H. G. Grundman and E. A. Teeple, Sequences of consecutive happy numbers, Rocky Mountain J. Math., to appear.

[4] H. G. Grundman and E. A. Teeple, Generalized happy numbers, Fibonacci Quart., 39 (2001), 462–466.

[5] H. G. Grundman and E. A. Teeple, Heights of happy numbers and cubic happy numbers, Fibonacci Quart., 41 (2003), 301–306.

[6] R. Guy, Unsolved Problems in Number Theory, Springer-Verlag, 2nd ed., 1994.

[7] N. J. A. Sloane,  The On-Line Encyclopedia of Integer Sequences,  2006,

   http://www.research.att.com/~njas/sequences/.

2000 Mathematics Subject Classification: Primary 11A63. Keywords: happy numbers, consecutive, base.

(Concerned with sequence \underline{A000108}.)

Received June 29 2006; revised version received January 8 2007. Published in Journal of Integer Sequences, January 8 2007.

Return to Journal of Integer Sequences home page.