[seqfan] (by way of the admin) Formula for A131987, and relation to A101279 and A000265

Olivier Gerard olivier.gerard at gmail.com
Fri Mar 4 15:33:46 CET 2016


Dear Members,

I do not accept anonymous messages nor
anonymous subscriptions to seqfan
whatever the reason.

I would have preferred that the author of this mail
just send this question to the list without an alias
but members of the list might be interested to contribute
to a conversation going on about these sequences
on math.stackexchange.com

Please do not answer on seqfan, go on the stackexchange
site if you want to answer this or use the email address
s/he provided.

It will be good if the entries for these sequences are improved
in the process (formulas, illustrations, interpretations, etc.)

Olivier Gérard
Seqfan Mailing List Administrator




---------- Forwarded message ----------
From: Nominal Animal <question at nominal-animal.net>
Date: Tue, 1 Mar 2016 14:04:04 +0200

Working with binary trees and estimating floating-point error cases brought
two functions to my attention:

    i(k,N) = (k - 2^q(k)) 2^(N-q(k)) + 2^(N-q(k)-1)
    k(i,N) = (b(i + 2^N) - 1) / 2
where i, k, N are positive integers, and q(k) is the number of binary
digits in k, or
    q(k) = floor(log2(k))
and b(i) is the largest odd divisor of i.For 1 <= x < 2^N,
    k(i(x,N),N) == x
    i(k(x,N),N) == x

b(i) is OEIS A000265.

i(k,N) generates A131987:
    A131987(i, n) = (i - 2^floor(log2(i))) 2^(n-floor(log2(i))) +
2^(n-floor(log2(i))-1)
where
    1 <= i <= 2^n, n >= 1.

k(i,N) is a variant of A101279; just formulated using two parameters, as
for A131987 above.
It produces A101279, except for the ones between sequences (for different
N).

Thus, sequences A131987 and A101279 are related
("invert" or "complement" each other?),
when the two-parameter form is used.

For background, see
http://math.stackexchange.com/questions/1675498/references-to-these-functions-relating-to-binary-trees-and-binary-digit-counting
where I asked for references to the functions,
and how they relate/are useful in practice.

I'm not interested in the sequences themselves,
only in that they are quite useful in practice.

Adding the direct definition of i(k,N) to A131987 might be useful.



More information about the SeqFan mailing list