login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A103823
Table of "maximum oddness" operation.
2
0, 1, 1, 2, 1, 2, 3, 1, 1, 3, 4, 3, 2, 3, 4, 5, 1, 3, 3, 1, 5, 6, 5, 2, 3, 2, 5, 6, 7, 1, 5, 3, 3, 5, 1, 7, 8, 7, 6, 3, 4, 3, 6, 7, 8, 9, 1, 7, 3, 5, 5, 3, 7, 1, 9, 10, 9, 2, 7, 6, 5, 6, 7, 2, 9, 10, 11, 1, 9, 3, 7, 5, 5, 7, 3, 9, 1, 11, 12, 11, 10, 3, 4, 7, 6, 7, 4, 3, 10, 11, 12, 13, 1, 11, 3, 9, 5, 7, 7, 5
OFFSET
0,4
COMMENTS
T(i,j) is whichever of i,j has the 1 in the rightmost differing bit of their binary representations. Defines a complete ordering of the integers: all odd numbers are "more odd" than all even numbers, for numbers of same parity remaining bits are recursively compared to determine ordering.
LINKS
Rémy Sigrist, Colored representation of T(n, k) for n, k = 0..1023 (where the hue is function of T(n, k))
FORMULA
T(i, j) = max(Ri, Rj), where Rn is the reflection of n at the "binary point".
EXAMPLE
T(11,13)=11, since the rightmost differing bit position is 1 for 11=1011 binary and 0 for 13=1101 binary.
PROG
(PARI) T(n, k) = { if (n==k, return (n), for (i=0, oo, my (nn=bittest(n, i), kk=bittest(k, i)); if (nn && !kk, return (n), kk && !nn, return (k)))) } \\ Rémy Sigrist, Feb 08 2020
CROSSREFS
Cf. A103822 (the complementary operation).
Sequence in context: A328902 A159335 A109004 * A355246 A136642 A080382
KEYWORD
base,easy,nonn,tabl
AUTHOR
Marc LeBrun, Feb 16 2005
STATUS
approved