How to interpret the OEIS function for the "even fractal sequence" A103391 (1, 2, 2, 3, 2, 4, 3, 5, ...)

154 Views Asked by At

I'm interested in a particular integer sequence that is the same as itself when you remove all of the even-indexed members of the sequence. It begins (1, 2, 2, 3, 2, 4, 3, 5, ...). I looked it up in the Online Encyclopedia of Integer Sequences, and it is A103391—it's page is here: https://oeis.org/A103391.

I'm having trouble interpreting the formula given for the sequence on that page by Johannes W. Meijer. First I'll just paste it as it is on the page:

a((2*n-3)*2^p+1) = n, p >= 0 and n >= 2, with a(1) = 1

I'm interpreting this to be: $$ a\left(\left(2n-3\right)2^{p+1}\right)=n $$ with the associated conditions.

On it's face, the equation doesn't make sense to me, and I'm assuming there's either some sort of OEIS shorthand or convention for sequence description that I'm missing. I'm assuming that $n$ is the $n$th interger in the sequence, but I'm not sure what $p$ would be. And anyway, it seems to generate nonsense, such as, if $n=3$: $$ 3*2^{p+1}=3 $$ which would require $p$ to be $-1$, which is outside the range. If the equation is in fact $$ a\left(\left(2n-3\right)2^p+1\right)=n $$ Then it's even worse because, at $n=3$: $$ 3*2^p+1=3\\ 2^p=\frac23\\ p=\log_2\frac23\\ p\approx-.58 $$ which is both outside the bound and non-integral. I imagine I'm missing something really stupid, but I just can't put my finger on it.

2

There are 2 best solutions below

4
On BEST ANSWER

The formula is the second interpretation: $a((2n-3)2^p+1)=n$. Here plugging in $n$ does not mean finding the $n$th element of the sequence; instead, it's telling you all the places in the sequence where the value is $n$. For example, when $n=4$, the formula tells you that $a(5\cdot 2^p+1)=4$ for any $p\ge0$. Indeed, $4=a(6)=a(11)=a(21)=a(41)=a(81)=\cdots$.

If you want to calculate $a(m)$ for some odd $m$ using this formula, you need to write $m$ in the form $(2n-3)2^p+1$ for some $p\ge0$ and $n\ge2$. To do so, simply divide $m-1$ by $2$ repeatedly until you reach an odd number $k$, and then set $n=(k+3)/2$. For example, to calculate $a(2017)$, we keep halving $2016\to1008\to504\to252\to126\to63$, whence $a(2017)=n=(63+3)/2=33$.

0
On

By order of operations, a((2*n-3)*2^p+1) means $a((((2\times n)-3) \times 2^p)+1) = a(2^{p}(2n-3)+1)$.

For example, let $n = 4$ and $p = 1$, then $$ a(2^{1}(\underbrace{2 \times 4 -3}_5)+1) = a(11) = 4. $$

We can let $p$ be any non-negative integer.