4

Suppose I take a finite string of positive reals 1 4 19 3 In the first step, I find the absolute difference between consecutive numbers, the above string becomes

(4-1) (19-4) (19-3) (3-1) ⟹ 3 15 16 2

3 15 16 2

12 1 14 1

11 13 13 11

2 0 2 0

2 2 2 2

0 0 0 0

Taking any arbitrary string of n numbers, is it possible to determine whether or not this ends in 0s?

By trial and error, I found out that strings of length 2,4 always end at 0, however strings of length 3,5,8 can sometimes loop in binary.

jjagmath
  • 18,214
  • There probably is no such rule, see e.g. https://en.wikipedia.org/wiki/Gilbreath%27s_conjecture or http://list.seqfan.eu/pipermail/seqfan/2023-May/074580.html – R. J. Mathar Jul 26 '23 at 13:59
  • It appears that the webpage is more similar to something like the finite difference theorem, where the sequence is infinite, and the numbers at the end and start of the string have no operation. still interesting ) – General ASWalter Jul 26 '23 at 14:39
  • 1
    $(0,n,n) ; (n,0,n); (n,n,0); $ – Will Jagy Jul 26 '23 at 14:45

1 Answers1

5

Write your starting string as a column vector $$ \bf v = \pmatrix{v_1\cr v_2\cr \ldots\cr v_n}$$ If the initial values are integers, all subsequent ones will also be integers. Modulo $2$, your differencing operation corresponds to multiplication by an $n \times n$ matrix

$$ A = \pmatrix{1 & 1 & 0 & \ldots& 0\cr 0 & 1 & 1 & \ldots &0 \cr \ldots & \ldots & \ldots & \ldots & \ldots\cr 1 & 0 & 0 & \ldots & 1\cr} = I + S $$ where $S$ corresponds to a "shift" with $S^n = I$. If $n$ is not a power of $2$, the characteristic polynomial $p(z) = (z+1)^n + 1$ of $A$ over the binary field $GF(2)$ is not $z^n$, and if $\bf v \ne \bf 0$ is in the null space of $q(A)$ where $q(z) | p(z)$ with $q(0) \ne 0$ it can't be in the null space of a power of $A$. The conclusion, then, is that if $n$ is not a power of $2$, there is some initial string of $0$'s and $1$'s such that all the iterates will always have at least one $1$.

EDIT: For example, for $n = 6$, $z^2+z+1$ is a factor of $(z+1)^6 + 1 = z^6 + z^4 + z^2$, and $$A^2 + A + I \equiv \pmatrix{1 & 1 & 1 & 0 & 0 & 0\cr 0 & 1 & 1 & 1 & 0 & 0\cr 0 & 0 & 1 & 1 & 1 & 0\cr 0 & 0 & 0 & 1 & 1 & 1\cr 1 & 0 & 0 & 0 & 1 & 1\cr 1 & 1 & 0 & 0 & 0 & 1\cr} \mod 2$$ The vector $\bf v = \pmatrix{1 \cr 1 \cr 0 \cr 1 \cr 1 \cr 0\cr}$ is in the null space of this mod $2$, and the iterations go $$ \pmatrix{1 \cr 1 \cr 0 \cr 1 \cr 1 \cr 0\cr} \to \pmatrix{0 \cr 1 \cr 1 \cr 0 \cr 1 \cr 1 \cr } \to \pmatrix{1 \cr 0 \cr 1 \cr 1 \cr 0 \cr 1 \cr } \to \pmatrix{1 \cr 1 \cr 0 \cr 1 \cr 1 \cr 0\cr} \to \ldots$$

EDIT: On the other hand, if $n$ is a power of $2$, $p(z) = z^n$ and $A$ is nilpotent mod $2$. Thus if you start out with a vector of integers, after $n$ iterations you have even integers. After $kn$ iterations, you have multiples of $2^k$. But after the first iteration, which produces a vector of nonnegative entries, the maximum of the entries never increases; thus eventually the only multiple of $2^k$ that is small enough is $0$. So in this case you do get all $0$'s.

The same applies, by scaling, if you start with a vector of rational numbers.

Robert Israel
  • 448,999