Help for defining sequence

65 views
Skip to first unread message

Ramon Ortega

unread,
Apr 16, 2026, 9:42:23 AM (8 days ago) Apr 16
to SeqFan

Could someone in this group please help me correct the errors and ambiguities in the definition of this sequence?

1, 2, 1, 3, 10, 1, 4, 2, 20, 1, 5, 100, 10, 110, 1, 6, 11, 201, 20, 23, 1, 7, . . .


Square matrix T(n, k) read by antidiagonals of the s(n) = sums of the powers of ten in the binary expansion of the positive integers n such that: T(n, 1) = n and T(n, k+1) = s(T(n, k))


….1….2….3….4….5….6….7….8…9……10….11….12….

1……1       1       1        1        1       1       1      1       1            1           1          1 . . .
2….2     10     20    110      23    13    12  101  112  10002    1212 . . .

3…..3       2     10      20    110    23    13    12   101      112  10002   1212  . . .

4…..4   100  201    202    121 . . .

5….5     11   12    101    112  . . .

6….6     11   12    101    112  . . .
.        .      .      .       .
.        .      .      .       .
.        .      .      .       . 


Examples:


T(3, 11) = s(T(3, 10)) = s(112) = 1+1+10000 = 10002
T(3, 12) = s(T(3, 11)) = s(10002) = 100+1+1+1000+100+10 = 1212

M F Hasler

unread,
Apr 16, 2026, 10:30:55 AM (8 days ago) Apr 16
to seq...@googlegroups.com
It's unclear what you mean by " integerS n such that..."
in the definition of T(n,k) the n is given. (I suspect you did not mean "integers n" in plural, but I'm not sure and although it might seem like nitpicking about a negligible typo, that "detail" completely changes the meaning.)

To simplify the guesswork for your readers, you should give the examples step by step, like : 
for n=3, we have the binary expansion ... so s(n) = ... and therefore T(n,k=1) =...,  T(n,k=2) =..., etc

- Maximilian


--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/315c6271-1668-423a-b2b3-fac5586ff250n%40googlegroups.com.

Gareth McCaughan

unread,
Apr 16, 2026, 10:55:36 AM (8 days ago) Apr 16
to seq...@googlegroups.com
On 16/04/2026 15:30, M F Hasler wrote:
It's unclear what you mean by " integerS n such that..."
in the definition of T(n,k) the n is given. (I suspect you did not mean "integers n" in plural, but I'm not sure and although it might seem like nitpicking about a negligible typo, that "detail" completely changes the meaning.)

To simplify the guesswork for your readers, you should give the examples step by step, like : 
for n=3, we have the binary expansion ... so s(n) = ... and therefore T(n,k=1) =...,  T(n,k=2) =..., etc

- Maximilian


On Thu, Apr 16, 2026, 09:42 Ramon Ortega <tumblr3...@gmail.com> wrote:

Could someone in this group please help me correct the errors and ambiguities in the definition of this sequence? 1, 2, 1, 3, 10, 1, 4, 2, 20, 1, 5, 100, 10, 110, 1, 6, 11, 201, 20, 23, 1, 7, . . . Square matrix T(n, k) read by antidiagonals of the s(n) = sums of the powers of ten in the binary expansion of the positive integers n such that: T(n, 1) = n and T(n, k+1) = s(T(n, k))

….1….2….3….4….5….6….7….8…9……10….11….12….

1……1       1       1        1        1       1       1      1       1            1           1          1 . . . 2….2     10     20    110      23    13    12  101  112  10002    1212 . . .

3…..3       2     10      20    110    23    13    12   101      112  10002   1212  . . .

4…..4   100  201    202    121 . . .

5….5     11   12    101    112  . . .

6….6     11   12    101    112  . . . .        .      .      .       . .        .      .      .       . .        .      .      .       . 


Examples:


T(3, 11) = s(T(3, 10)) = s(112) = 1+1+10000 = 10002 T(3, 12) = s(T(3, 11)) = s(10002) = 100+1+1+1000+100+10 = 1212 -- 

After a bit of staring at this, I think I know what it means.

To calculate s(n), first write down n's binary representation; e.g., 10002 = 10011100010010_2.

Then split it up before each 1 to obtain a sequence of chunks of the form 1(0*). So 10002 gives 100 1 1 1000 100 10.

Now treat each of those chunks as a _decimal_ number, and add them up. 100+1+1+1000+100+10 = 1212.

This is s(n).

Now construct a 2d array that has 1,2,3,... down the left side and each row of which is constructed by iteratively applying s; that is, the (row i, column j) entry is s^(j-1)(i).

Finally, read this off by antidiagonals to get the sequence.

For a one-sentence definition suitable for the title of an OEIS entry (though I'm not convinced this is interesting enough to deserve one -- but I am generally super-skeptical of such base-10-specific things, and others may have different tastes), maybe something like this.

"Array T(n,k) read by antidiagonals, where T(n,k) is obtained from n by (k-1) iterations of writing in binary, splitting before each 1, interpreting pieces as base-10 numbers, and adding."

-- 
g

Message has been deleted

Ramon Ortega

unread,
Apr 16, 2026, 11:02:07 AM (8 days ago) Apr 16
to SeqFan
Thank you for your observations, Maximilian:

An integer n>=1 in binary can be understood as a single concatenation of powers of ten = {1, 10, 100, 1000, ...10^k}

In the example I gave, 112 = 1110000₂ = [1] [1] [10000], that is, there is only this way to write 112 in base two as a concatenation of powers of ten. Therefore, s(112) = 1+1+10000 = 10002

Ramon Ortega

unread,
Apr 16, 2026, 11:13:08 AM (8 days ago) Apr 16
to SeqFan
Does the definition become clearer this way, Maximilian?

Square matrix T(n, k) read by its antidiagonals such that: T(n, 1) = n and T(n, k+1) = s(T(n, k)), where s(n) = sum of the powers of ten in the binary expansion of the positive integers n

Ramon Ortega

unread,
Apr 16, 2026, 11:52:56 AM (8 days ago) Apr 16
to SeqFan

Could someone in this group please help me correct the errors and ambiguities in the definition of this sequence?

1, 2, 1, 3, 10, 1, 4, 2, 20, 1, 5, 100, 10, 110, 1, 6, 11, 201, 20, 23, 1, 7, . . .

Square matrix T(n, k) read by its antidiagonals such that: T(n, 1) = n and T(n, k+1) = s(T(n, k)), where s(n) = sum of the powers of ten in the binary expansion of the positive integers n

Examples:



An integer n>=1 in binary can be understood as a single concatenation of powers of ten = {1, 10, 100, 1000, ...10^k}

112 = 1110000₂ = [1] [1] [10000], that is, there is only this way to write 112 in base two as a concatenation of powers of ten. Therefore,

s(1) = 1₂ = 1
s(2) = 10₂= 10
s(3) = 11₂= 1+1 = 2
s(4) = 100₂ = 100
s(5) = 101₂= 10+1 = 11
s(6) = 110₂= 1+10 = 11
s(7) = 111₂= 1+1+1 = 3
s(8) = 1000₂= 1000
s(9) = 1001₂ = 100+1 = 101
s(10) = 1010₂= 10+10 = 20
.
.
s(112) = 1110000₂ = 1+1+10000 = 10002

etc.


T(3, 11) = s(T(3, 10)) = s(112) = 1+1+10000 = 10002

T(3, 12) = s(T(3, 11)) = s(10002) = 100+1+1+1000+100+10 = 1212

T(4, 5) = s(T(4, 4)) = s(202) = 11001010₂ = 1+100+10+10 = 121


etc.


….1….2….3….4…..5…..6…..7….8……9…….10……11……12……

1……1       1       1        1        1        1        1        1           1               1             1              1 . . ….

2….2     10     20    110      23     13     12    101      112      10002       1212 . . .  . .  . . ……..

3…..3       2     10      20    110     23      13     12        101          112     10002       1212  . . .

4…..4   100  201    202    121 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5….5     11   12    101    112  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  

6….6     11   12    101    112  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 

Allan Wechsler

unread,
Apr 16, 2026, 12:02:49 PM (8 days ago) Apr 16
to seq...@googlegroups.com
Ramon, a few things would clarify your presentation.

First, in OEIS entries, the variable "n" almost always refers to the sequence index; I suggest you use a different letter for your table row index.

Second, using the term "power of ten" to refer to a 1 followed by all its consecutive 0s in a binary expansion is just asking for trouble. I would have said something like this: "Parse the binary expansion of j into concatenated bit strings consisting of a 1 followed by all consecutive 0s. Reinterpret these substrings in decimal and add them."

I understand that your main concern here is the dynamics of the function s, that is, what happens when you apply s over and over again to some starting value. The rows of your table give the resulting behavior for each possible starting value. If this is interesting (and I'm not sure it is), then the function s itself must be interesting, but s(n): 1, 10, 2, 100, 11, 11, 3, 1000, 101, 20, 13, ... is not in OEIS. And if s(n) is not an interesting enough sequence, I can't see how the antidiagonals of (s^k)(j) are.

Finally, regarding the dynamics of s itself: I don't know if I did this right, and I hope somebody can check me. Perhaps it is surprising that the sequence (s^n)(2), for example, doesn't "blow up". But a moment's analysis reveals that s has a sort of a "lid" on it, and that as k gets very large, s(k) is almost always much smaller than k. In fact, the list of numbers k for which s(k) > k, which starts out very copiously, thins out quite rapidly. (This sequence is also not in OEIS.)

This kind of "lid" almost always suggests periodic dynamics, as shown, for instance, in the Collatz problem. I calculated the following chain starting at 2, using an online decimal-to-binary converter, but doing the parsing and adding by hand, so if somebody would be kind enough to verify my work I'd appreciate it:

2, 10, 20, 110, 23, 13, 12, 101, 112, 10002, 1212, 213, 32, 100000, 110022, 1045, 100021, 10044, 305, 1102, 1112, 2011, 27, 13, ...

So the trajectory enters a cycle with period 18. Your table shows that many numbers quickly get trapped in the same cycle. My intuition is that there are very few such limit cycles, and that all starting numbers relatively quickly get funnelled into one of them.

TL;DR: use better variable names; don't call strings of bits "powers of 10"; include conceptually simpler ideas before jumping to the antidiagonals of the dynamics table.

-- Allan

Jeffrey Shallit

unread,
Apr 16, 2026, 12:10:54 PM (8 days ago) Apr 16
to seq...@googlegroups.com
I think there is some confusion here between numbers, powers, and the representation of numbers.  There are no "powers of 10" in the "binary expansion of n".  There are digits 1 and 0.  You seem to be defining a sequence s that treats a binary expansion as if it is a concatenation of groups of digits of the form "1 0...0", where there are i zeros, and then interpreting each group as if it were 10^i (the integer "ten" raised to the i power) and summing the result.  In order to make your sequence comprehensible, you should probably just submit s itself as one sequence first.

If I understand s correctly, then s(12345) = 1000104.

The first few terms are then
1, 10, 2, 100, 11, 11, 3, 1000, 101, 20, 12, 101, 12, 12, 4, 10000, 1001, 110, 102, 110, 21, 21, 13, 1001, 102, 21, 13, 102, 13, 13,
       5, 100000, 10001, 1010, 1002, 200, 111, 111, 103, 1010, 111, 30, 22, 111, 22, 22, 14, 10001, 1002, 111

Allan Wechsler

unread,
Apr 16, 2026, 1:15:51 PM (8 days ago) Apr 16
to seq...@googlegroups.com
I found another limit cycle, in addition to the two we've found already, (s^1)(1) = 1 and (s^18)(13) = 13.

It's (s^1)(21) = 21. The smallest starting number that feeds into this cycle is 8.

-- Allan


Michel Marcus

unread,
Apr 16, 2026, 1:27:24 PM (8 days ago) Apr 16
to seq...@googlegroups.com
I agree with Jeffrey suggestion.

Sans virus.www.avast.com

Message has been deleted

Ramon Ortega

unread,
Apr 16, 2026, 2:00:06 PM (8 days ago) Apr 16
to SeqFan
Thank you very much for the observations and for expanding the function s(n) to so many values.

My idea is to consider each positive integer in binary as a concatenation of powers of ten with non-negative integer exponents -- {1, 10, 100, 1000, ... 10^n} -- because I believe that each positive integer corresponds to a unique set of powers of ten when written in base two. The function n, therefore, is the sum of the elements of this set.

Example:

8 = 1000₂ ⟹ s(8) = 1000

2026 = 11111101010₂ ⟹ s(2026) = 1+1+1+1+1+10+10+10 = 35

s(n) associates each positive integer with the sum of the elements of the unique set of powers of ten, whose concatenation is the representation of n in base two. The first terms of s(n) calculated by j.sh...@gmail.com

s(n) = {1, 10, 2, 100, 11, 11, 3, 1000, 101, 20, 12, 101, 12, 12, 4, 10000, 1001, 110, 102, 110, 21, 21, 13, 1001, 102, 21, 13, 102, 13, 13, 5, 100000, 10001, 1010, 1002, 200, 111, 111, 103, 1010, 111, 30, 22, 111, 22, 22, 14, 10001, 1002, 111, . . . }

How about this edited definition below?

Square matrix T(n, k) read by its antidiagonals such that: T(n, 1) = n and T(n, k+1) = s(T(n, k)), where s(n) = sum of the "powers of ten", in the binary expansion of n, considering this expansion as if it were the concatenation of a unique set of powers of ten with non-negative integer exponents.

Em quinta-feira, 16 de abril de 2026 às 12:13:08 UTC-3, Ramon Ortega escreveu:

Ramon Ortega

unread,
Apr 16, 2026, 2:15:28 PM (8 days ago) Apr 16
to SeqFan
How about this new edited definition below?

Square matrix T(n, k) read by its antidiagonals such that: T(n, 1) = n and T(n, k+1) = s(T(n, k)), where s(n) = sum of the powers of ten with non-negative integer exponents that, by concatenation, can uniquely represent n in base two.

Ramon Ortega

unread,
Apr 16, 2026, 2:28:48 PM (8 days ago) Apr 16
to SeqFan
Thank you very much for your observations and research on the dynamics, Allan. I don't know if the edited definition of s(n) that I posted has improved. I liked your perception of the cycles. I had only noticed s(1) and s(21). I conjectured that possibly all the cycles might be in s(2). What do you think?

Allan Wechsler

unread,
Apr 16, 2026, 4:19:57 PM (8 days ago) Apr 16
to seq...@googlegroups.com
I wrote a stupid Python program and search for other cycles. The two fixed points, 1 and 21, and the 18-cycle that starts at 13, account for all starting values less than 1,000,000. I am extending my search to 10,000,000, but I'm going to conjecture right now that that's all there is.

-- Allan


Ramon Ortega

unread,
Apr 16, 2026, 4:36:34 PM (8 days ago) Apr 16
to SeqFan
Could you post the program so I can research it too, Allan?

Allan Wechsler

unread,
Apr 16, 2026, 6:01:11 PM (8 days ago) Apr 16
to seq...@googlegroups.com
I have pushed through to 10,000,000 and found no other cycles.

-- Allan

# Dynamics of Ramon Ortega's s function s(n) = the sum of substrings
# of the binary representation of n, of the form 10*, interpreted in
# decimal.

def ortega_cycle_start(k):
    seen = []
    while True:
        if k in seen:
            return k
        seen.append(k)
        k = ortega_s(k)

def ortega_s(k):
    sum = 0
    while k > 0:
        k, bottom = bottom_chunk(k)
        sum += bottom
    return sum

def bottom_chunk(k):
    n = 0
    while k % 2 == 0:
        k //= 2
        n += 1
    return (k - 1) // 2, 10**n

def ortega_scan(lo, hi):
    seen = []
    for x in range(lo,hi):
        s = ortega_cycle_start(x)
        if s in seen:
            continue
        seen.append(s)
    return seen

Ramon Ortega

unread,
Apr 16, 2026, 9:42:44 PM (8 days ago) Apr 16
to seq...@googlegroups.com
Up to ten million, only the cycles (1, 1), (13, 18), and (21, 1) were found?

Allan Wechsler

unread,
Apr 16, 2026, 10:19:22 PM (8 days ago) Apr 16
to seq...@googlegroups.com
That is correct: those are the only three cycles. And the further we go, the less likely it is that any other cycles exist.

-- Allan

Reply all
Reply to author
Forward
0 new messages