login
A306346
Start with the sequence S(1) = [0], and for n >= 1 define S(n+1) to equal the concatenation of S(n) with the RUNS transform of S(n) when read in reverse order. This sequence is the limit of that process as n goes to infinity.
0
0, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 7, 1, 1, 1, 1, 1, 5, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, 7, 1, 1, 1, 1, 1, 3, 1, 7, 1
OFFSET
1,5
COMMENTS
Conjecture 1: a(n) <= 7.
Conjecture 2: a(n) is odd for n > 1 and when a(n) = 3, 5 or 7, n is odd.
Property of the sequence:
a(n) = 3 for the odd values n = 5, 9, 13, 15, 21, 23, 25, 37, 39, ...
a(n) = 5 for the odd values n = 33, 57, 75, 93, 111, 115, 129, 147, ...
a(n) = 7 for the odd values n = 51, 79, 87, 121, 133, 141, 185, 203, ...
Remark:
If row 1 = [1], the sequence a(n) becomes b(n) = 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2, 1, 3, 1, 3, 1, 1, 1, ... and it is conjectured that b(n) <= 7.
Statistics for n <= 10^5:
+--------------+-------------------------+------------+
| a(n) | number of occurrences | percentage |
| | for n <= 10^5 | |
+--------------+-------------------------+------------+
| 1 | 72244 | 72.244% |
| 3 | 18030 | 18.030% |
| 5 | 6806 | 6.806% |
| 7 | 2919 | 2.919% |
+--------------+-------------------------+------------+
EXAMPLE
We may consider this sequence to be the limit of the rows of the irregular triangle in which row n+1 equals the concatenation of row n with the RUNS transform of row n when read in reverse order, as illustrated below.
Start with row 1 = [0];
the RUNS of row 1 in reverse = [1], so row 2 = row 1 + [1] = [0, 1];
the RUNS of row 2 in reverse = [1, 1], so row 3 = row 2 + [1, 1] = [0, 1, 1, 1];
the RUNS of row 3 in reverse = [3, 1], so row 4 = row 3 + [3, 1] = [0, 1, 1, 1, 3, 1];
the RUNS of row 4 in reverse = [1, 1, 3, 1], so row 5 = row 4 + [1, 1, 3, 1] = [0, 1, 1, 1, 3, 1, 1, 1, 3, 1];
etc.
The irregular triangle starts:
[0];
[0, 1];
[0, 1, 1, 1];
[0, 1, 1, 1, 3, 1];
[0, 1, 1, 1, 3, 1, 1, 1, 3, 1];
[0, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1];
[0, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1];
...
in which the limit of the rows yields this sequence.
The row lengths of the above triangle equal A381357 (offset 3).
MAPLE
n0:=1:T:=array(1..1000, [0$1000]):
for n from 1 to 50 do :
it:=1:i:=n0:
for k from n0 by -1 to 2 do:
if T[k]=T[k-1]
then
it:=it+1:
else
i:=i+1:T[i]:=it:it:=1:
fi:
od:
i:=i+1:T[i]:=1:n0:=i:
od:
print(T):
PROG
(PARI) \\ From Paul D. Hanna, Mar 04 2025: (Start)
\\ Print the first N rows of the irregular triangle.
\\ This sequence equals the limit of the rows.
\\ RUNS(V) Returns vector of run lengths in vector V:
{RUNS(V) = my(R=[], c=1); if(#V>1, for(n=2, #V, if(V[n]==V[n-1], c=c+1, R=concat(R, c); c=1))); R=concat(R, c)}
\\ REV(V) Reverses order of vector V:
{REV(V) = Vec(Polrev(Ser(V)))}
\\ Generates N rows as a vector A of row vectors
{N=12; A=vector(N); A[1]=[0];
for(n=1, #A-1, A[n+1] = concat(A[n], RUNS(REV(A[n]))); ); }
for(n=1, N, print(A[n])) \\ (End)
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Michel Lagneau, Feb 09 2019
EXTENSIONS
Name corrected and edited by Paul D. Hanna, Mar 05 2025
STATUS
approved