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.

A304453 An expanded binary notation for n: the normal binary expansion for n is expanded by mapping each 1 to 10 and retaining the existing 0's.

Original entry on oeis.org

0, 10, 100, 1010, 1000, 10010, 10100, 101010, 10000, 100010, 100100, 1001010, 101000, 1010010, 1010100, 10101010, 100000, 1000010, 1000100, 10001010, 1001000, 10010010, 10010100, 100101010, 1010000, 10100010, 10100100, 101001010, 10101000, 101010010, 101010100, 1010101010, 1000000, 10000010, 10000100
Offset: 0

Views

Author

Rick L. Shepherd, May 12 2018

Keywords

Comments

This notation is used by Penrose for specifying Turing machine examples. In general, this notation is much more compact than unary. Because no number encoded by this notation contains two or more consecutive 1's, there are an infinite number of additional strings available such as 110, 1110, 11110, ... for specifying delimiters (in lists of numbers), operations, etc. In some contexts, zero may alternately be represented by no symbol at all, for example, when there are two immediately-consecutive delimiters (commas).

Examples

			a(3) = 1010 because 3 in binary is A007088(3) = 11 and each 1 has been replaced by 10 here. Similarly, a(4) = 1000 because A007088(4) = 100 and the expansion adds another 0 after the 1.
		

References

  • R. Penrose, The Emperor's New Mind, Oxford, 1989, pp. 42-46.

Crossrefs

Cf. A007088.

Programs

  • Maple
    a:= n-> (l-> parse(cat(seq(10*l[-i], i=1..nops(l)))))(convert(n, base, 2)):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 08 2021
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits[n,2]/.(1->{1,0})]],{n,0,40}] (* Harvey P. Dale, Sep 07 2019 *)
  • PARI
    {a(n) = my(B, k);
            if(n >= 0,
              B = List(binary(n)); k = 1;
              while(k <= #B,
                if(B[k] == 1,
                  k++; listinsert(B, 0, k));
                k++);
              sum(k = 1, #B, B[k]*(10^(#B - k))))}
    
  • Python
    def a(n): return int(bin(n)[2:].replace('1', '10'))
    print([a(n) for n in range(35)]) # Michael S. Branicky, Jan 08 2021