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”).

A318926
Take the binary expansion of n, starting with the least significant bit, and concatenate the lengths of the runs.
3
1, 11, 2, 21, 111, 12, 3, 31, 121, 1111, 211, 22, 112, 13, 4, 41, 131, 1121, 221, 2111, 11111, 1211, 311, 32, 122, 1112, 212, 23, 113, 14, 5, 51, 141, 1131, 231, 2121, 11121, 1221, 321, 3111
OFFSET
1,2
COMMENTS
Obviously this compressed notation is useful only for n < 1023. A227736 is a version which works for all n.
LINKS
Claude Lenormand, Deux transformations sur les mots, Preprint, 5 pages, Nov 17 2003. Apparently unpublished. This is a scanned copy of the version that the author sent to me in 2003. - N. J. A. Sloane, Sep 09 2018. See Procedure 1.
EXAMPLE
n, binary, run lengths, -> a(n)
1, [1], [1] -> 1
2, [0, 1], [1, 1] -> 11
3, [1, 1], [2] -> 2
4, [0, 0, 1], [2, 1] -> 21
5, [1, 0, 1], [1, 1, 1] -> 111
6, [0, 1, 1], [1, 2] -> 12
7, [1, 1, 1], [3] -> 3
8, [0, 0, 0, 1], [3, 1] -> 31,
...
PROG
(Python)
from itertools import groupby
def A318926(n): return int(''.join(str(len(list(g))) for k, g in groupby(bin(n)[:1:-1]))) # Chai Wah Wu, Mar 11 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 09 2018
STATUS
approved