Question about a sequence

I made the sequence A000120, the one that goes [1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,...]. The sequence turns the numbers into binary form and counts the amount of 1s in it. The first instance of n in the sequence is (2^n)-1. Now what if we turn the sequence to the next level? We turn every number of this sequence into binary form and count the 1s in it. Now we can predict that the first instance of 1 is already 2^(2^n-1)-1, which is already large. The first instance of 4 is 32767. Because we made a big sequence, let's make a bigger one.
Instead of nesting it only 1 or 2 times, let's make the amount of nestings the index of the number. However, because Snap! lags over 100, I could only get the first 100 numbers of the sequence, and i still couldn't find any 2s in it.
Define f(n) as the first instance of "n" in this sequence. And now the question: what are approximations of f(n)? f(1) = 1. Also the f(n) sequence grows tetrationally.

I don't understand why the sequence isn't 1,1,1,1,... forever. 1 in binary has 1 ones, so...

it doesn't rely on the previous number to make new entries. entry 100 is the 100th number of the sequence iterated 100 times. What's happening is it's on the 100th iteration, it turns the 99th iteration to binary form and counts the 1s, which the 99th iteration turns the 98th iteration to binary form and counts the 1s, and so on.

Sorry, I still don't get it. Could you show me the actual arithmetic behind the first few elements of the sequence?

Let me see if I get it:
(everything below is with numbers in binary form)

Define ones(i) as: the number of 1’s in i
Define f(i) as onesi(i)


f(0) = ones0(0) = 0
f(1) = ones1(1) = ones(1) = 1
f(10) = ones10(10) = ones(ones(10)) = ones(1) = 1
f(11) = ones11(11) = ones(ones(ones(11))) = ones(ones(10)) = ones(1) = 1
f(100) = ones100(100) = ones(ones(ones(ones(100)))) = ones(ones(ones(1))) = ones(ones(1)) = ones(1) = 1

I guess we can safely assume that if f(i) = 1 for all integers i from 1 tot 1100100 (or 10010), it will be 1 for all integers i > 0 (that may be why it wasn’t included in OEIS: it’s just not a very exciting series :wink:). Perhaps @polymations could try to prove that

Yes, that is what i mean by the function.

"Yes, @qw23 is getting it", or "Yes, @polymations will try And how about my challenge for you to prove that f(i) = 1 for all integers i > 0" ? (or something else?)

I just realized something. In each iteration of the function, the index of the first 2 gets pushed back exponentially further and further,due to the amount of nestings of the ones function, which sadly means the index will never reach any number other than 1.

Correct. The amount of 1's grows more or less logarithmical with i, whereas the "reduction rate" (for lack of a better expression) through all of this nesting grows even faster than exponential (from i = 2, I'm using decimal notation now):

22 - 1 = 3
23 -1 = 7
27 -1 = 127
2127 -1 = 340282366920938463463374607431768211455
2340282366920938463463374607431768211455 -1 = a very large number

What's truly mind-boggling for me: this latter series is unlimited, too (I do understand your fascination with very large numbers, even though I wouldn't want to spend much too time on them).

Oh, so it's tetrational. I can define a new function Xe_m(n) (Named after xenon) which is the index of the first number n in the mth iteration of the series. Xe_n(n) grows tetrationally and is about f_3(n) in the fast growing hierarchy