Sunday 13 December 2020

Iterations that lead to a Constant or a Loop

One of my first encounters with an iterative process that leads to either a constant or a loop was with so-called happy numbers. See my post of 28th June 2018 titled Happy Numbers. The iterative process involved with these numbers is to repeatedly add the sums of squares of digits to either reach a constant (1) or enter a loop (4, 16, 37, 58, 89, 145, 42, 20, 4, ... ). Approximately, 15% of numbers are happy.

25286 is a happy number because the process leads to 1: 

25286 --> 133 --> 19 --> 82 --> 68 --> 100 --> 1

89 is a nominally unhappy number because the process leads to a loop:

89 --> 145 -->  42 --> 20 --> 4

Today I turned 26187 days old and this number forms part of OEIS A219960:


 A219960

Numbers which do not reach zero under the repeated iteration
x -> ceiling(sqrt(x)) * (ceiling(sqrt(x))^2 - x).


In the case of 26187 the iteration proceeds as follows:

[26187, 9234, 16975, 24366, 44431, 18990, 7452, 10179, 2222, 3936]

whereupon it enters the loop:

[2079, 1702, 2604, 5200, 9417, 18326, 23120, 44217, 64144, 94488, 115808, 161293, 125022, 104076, 81719, 22022, 26671, 36900, 67357, 63180, 81648, 42328, 22248, 37800, 43875, 47250, 59732, 71785, 10452, 16171, 27264, 48472, 81549, 70642, 30324, 52675, 51750, 53352, 2079]

Graphically the situation is as in Figure 1 with 161293 being the highest value reached:


Figure 1

Of the numbers up to 26187, 504 do not reach zero which represents a little under 2% of the total.

There is a similar iterative process involving the floor function (OEIS A219303):


 A219303



Numbers which do not reach zero under the repeated iteration
x -> floor(sqrt(x)) * (x - floor(sqrt(x))^2).


In the comments for OEIS A219960 (with the ceiling function), the following is stated:
Conjecture 1: All numbers under the iteration reach 0 or, like the elements of this sequence, reach a finite loop, and none expand indefinitely to infinity.

Conjecture 2: There are an infinite number of such finite loops, though there is often significant distance between them.

Conjecture 3: There are an infinite number of pairs of consecutive integers in this sequence despite being less abundant than in A219303.

In regard to Conjecture 3, we find that in the range from 1 to 26187, the following pairs occur:

(2222, 2223), (8399, 8400), (11457, 11458), (12950, 12951), (19005, 19006), (19847, 19848), (22444, 22445), (23597, 23598), (25089, 25090), (25175, 25176), (25742, 25743)

In the comments for OEIS A219303 (with the floor function), the following is stated:

Collatz-like hailstone behavior is evident, but the iteration more closely resembles the iteration used to determine happy numbers (A007770), albeit in a non-base-specific manner. Unlike happy numbers, and despite being approximately as dense in the integers, these numbers do not reach their iterative goal.

Conjecture 1: All numbers under the iteration reach 0 or, like the elements of this sequence, reach a finite loop, and none expand indefinitely to infinity.

Conjecture 2: There are an infinite number of such finite loops, though there is often significant distance between them.

Conjecture 3: There are an infinite number of pairs of consecutive integers in this sequence, e.g. 14 and 15, 197 and 198. This argument is strengthened by the fact there are other groupings such as triples - The first of these is 11527, 11528 and 11529 - and also that for randomly chosen numbers of hundreds of digits, N, the nearest pair or grouping appears to be within N +/- 1000.

We find that the 10,000th member of OEIS A219303 is 211,264 so the numbers have a density of around 4.73% which is well over twice the density of numbers in OEIS A219960. Figure 2 shows a plot of the trajectory of 211,264 using a log scale for the y axis. Notice that once it reaches 8 it flatlines and stay on 8 forever because floor(sqrt(8)) * (8 - floor(sqrt(8))^2) = 8:


Figure 2: permalink

No comments:

Post a Comment