cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A171885 Representation of n in D. E. Knuth's second prefix-unambiguous, order-preserving binary string system.

This page as a plain text file.
%I A171885 #20 Oct 25 2024 09:32:24
%S A171885 0,1,4,5,24,25,26,27,112,113,114,115,116,117,118,119,480,481,482,483,
%T A171885 484,485,486,487,488,489,490,491,492,493,494,495,1984,1985,1986,1987,
%U A171885 1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001
%N A171885 Representation of n in D. E. Knuth's second prefix-unambiguous, order-preserving binary string system.
%C A171885 The first two terms are the strings "00" and "01"; all others are binary strings beginning with "1".
%C A171885 With the important exception of a(1) = 1, when expressed in binary, any value not appearing in this sequence appears as an initial substring of later terms. For example, 6 (110) is an initial substring of 27 (11011).
%C A171885 From n = 128 on, a(n) > A010097(n), but the terms of the two sequences remain approximately the same size up to n = 511. - _M. F. Hasler_, Oct 24 2024
%D A171885 Donald E. Knuth, "Supernatural Numbers", in D. A. Klarner, editor, The Mathematical Gardner. Prindle, Weber and Schmidt, Boston, 1981, pp. 310-325.
%D A171885 Donald E. Knuth, Selected Papers on Fun and Games. Stanford, California: Center for the Study of Language and Information (2011).
%H A171885 Indranil Ghosh, <a href="/A171885/b171885.txt">Table of n, a(n) for n = 0..10000</a>
%H A171885 Robert Munafo, <a href="http://mrob.com/pub/math/altnum.html#lexi">Alternative Number Formats</a>, section on "Lexicographic Strings"
%F A171885 a(n) = n + 2*4^L - 3*2^L with L = floor(log_2(n)), for n > 1. - _M. F. Hasler_, Oct 24 2024
%e A171885 The representations start: 0 = "00"; 1 = "01"; 2 = "100"; 3 = "101"; 4 = "11000"; 5 = "11001"; 6 = "11010"; 7 = "11011"; 8 = "1110000"; 9 = "1110001"; and so on. See the references for longer lists and fuller explanation.
%o A171885 (PARI) apply( {A171885(n)=if(n>1, n-3<<(n=exponent(n))+2*4^n, n)}, [0..44]) \\ _M. F. Hasler_, Oct 24 2024
%Y A171885 Knuth's first system gives A000918 (less its initial term).
%Y A171885 Knuth's third system is A010097, the Levenshtein codes.
%K A171885 nonn
%O A171885 0,3
%A A171885 _Robert Munafo_, Mar 19 2010