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.

Showing 1-3 of 3 results.

A343963 a(0) = 0, and for any n > 0, the binary expansion of n has n digits and starts with the binary expansion of n, say of w digits, and in case n > w, the remaining binary digits in a(n) are those of a(n-w).

Original entry on oeis.org

0, 1, 2, 7, 9, 22, 55, 121, 137, 310, 695, 1529, 3209, 6966, 15031, 32249, 34297, 72841, 154422, 326327, 687609, 1410553, 2956425, 6183734, 12909239, 26902009, 55936505, 116202633, 241064758, 499448503, 1033534969, 2136311289, 2203420153, 4545387657
Offset: 0

Views

Author

Rémy Sigrist, May 05 2021

Keywords

Comments

To build the binary expansion of a(n):
- start with n indeterminate digits,
- while there are some, say m, indeterminate digits,
replace the first of them with the binary expansion of m.
The binary plot of the sequence has locally periodic patterns.

Examples

			For n = 10:
- the binary expansion of a(10) has 10 digits, and is the concatenation of:
   - the binary expansion of 10 which is "1010",
   - the binary expansion of 10 - 4 = 6 which is "110",
   - the binary expansion of 10 - 4 - 3 = 3 which is "11",
   - the binary expansion of 10 - 4 - 3 - 2 = 1 which is "1",
   - as 10 = 4 + 3 + 2 + 1, we stop here,
- so the binary expansion of a(10) is "1010110111",
- and a(10) = 695.
		

Crossrefs

Programs

  • PARI
    a(n) = { if (n==0, 0, my (k=n-#binary(n)); n*2^k+a(k)) }

Formula

A070939(a(n)) = n for any n > 0.

A348111 Numbers k whose binary expansion starts with the concatenation of the binary expansions of the run lengths in binary expansion of k.

Original entry on oeis.org

0, 1, 7, 14, 28, 112, 127, 254, 509, 1016, 1018, 1792, 2033, 2037, 2039, 4066, 4072, 4075, 4078, 8132, 8135, 8150, 8156, 16256, 16300, 16313, 32513, 32528, 32576, 32601, 32607, 32626, 32639, 32767, 65027, 65087, 65153, 65202, 65248, 65253, 65255, 65534, 130307
Offset: 1

Views

Author

Rémy Sigrist, Oct 01 2021

Keywords

Comments

We consider here that 0 has an empty binary expansion, and include it in the sequence.
This sequence is infinite as it contains A077585.

Examples

			Regarding 32607:
- the binary expansion of 32607 is "111111101011111",
- the corresponding run lengths are: 7, 1, 1, 1, 5,
- in binary: "111", "1", "1", "1", "101",
- after concatenation: "111111101",
- as "111111101011111" starts with "111111101", 32607 belongs to this sequence.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import groupby
    def ok(n):
        if n == 0: return True
        b = bin(n)[2:]
        c = "".join(bin(len(list(g)))[2:] for k, g in groupby(b))
        return b.startswith(c)
    print(list(filter(ok, range(2**17)))) # Michael S. Branicky, Oct 02 2021

A357118 Numbers such that the first digit is the number of digits and the second digit is the number of distinct digits.

Original entry on oeis.org

322, 323, 4222, 4224, 4242, 4244, 4300, 4303, 4304, 4311, 4313, 4314, 4322, 4323, 4324, 4330, 4331, 4332, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4345, 4346, 4347, 4348, 4349, 4353, 4354, 4355, 4363, 4364, 4366, 4373, 4374, 4377, 4383, 4384, 4388, 4393, 4394, 4399
Offset: 1

Views

Author

Marc Morgenegg, Oct 17 2022

Keywords

Comments

By definition, each term must be at least a two-digit number.
The sequence is finite. The last term is 989765432.
There are 11041830 terms. - Michael S. Branicky, Oct 20 2022

Examples

			322 is a term because the first digit is the number of digits = 3, and the second digit counts the different digits {2,3} = 2.
		

Crossrefs

Cf. A319678.

Programs

  • Python
    def ok(n):
        s = str(n)
        if len(s) < 2 or len(s) > 9: return False
        return len(s) == int(s[0]) and len(set(s)) == int(s[1])
    print([k for k in range(4394) if ok(k)]) # Michael S. Branicky, Oct 17 2022
Showing 1-3 of 3 results.