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-4 of 4 results.

A328282 a(n) is the least k such that A175930(k) = n.

Original entry on oeis.org

1, 3, 2, 15, 6, 4, 5, 255, 30, 12, 13, 16, 9, 11, 10, 65535, 510, 60, 61, 48, 25, 27, 26, 256, 33, 19, 18, 47, 22, 20, 21, 4294967295, 131070, 1020, 1021, 240, 121, 123, 122, 768, 97, 51, 50, 111, 54, 52, 53, 65536, 513, 67, 66, 79, 38, 36, 37, 767, 94, 44, 45
Offset: 1

Views

Author

Rémy Sigrist, Oct 11 2019

Keywords

Comments

To compute a(n):
- the binary representation of n has k = A000120(n) one bits,
- the binary representation of a(n) has k runs of consecutive equal bits,
- the length of the i-th run in a(n) has length 2^z where z is the number of zeros immediately following the i-th one bit in the binary representation of n,
- this division into sections starting with ones in n or corresponding to a run in a(n) is materialized by slashes in the example section.

Examples

			The first terms, alongside the binary representation of n and of a(n) with peer sections separated by slashes, are:
    n   a(n)   bin(n)   bin(a(n))
    --  -----  -------  ----------------
     1      1        1                 1
     2      3       10                11
     3      2      1/1               1/0
     4     15      100              1111
     5      6     10/1              11/0
     6      4     1/10              1/00
     7      5    1/1/1             1/0/1
     8    255     1000          11111111
     9     30    100/1            1111/0
    10     12    10/10             11/00
    11     13   10/1/1            11/0/1
    12     16    1/100            1/0000
    13      9   1/10/1            1/00/1
    14     11   1/1/10            1/0/11
    15     10  1/1/1/1           1/0/1/0
    16  65535    10000  1111111111111111
		

Crossrefs

Programs

  • PARI
    a(n)={ my (r=[], l, v=0); while (n, r=concat(l=1+valuation(n,2), r); n \= 2^l); for (i=1, #r, v *= 2^2^(r[i]-1); if (i%2, v += 2^2^(r[i]-1)-1)); v }

Formula

a(n) <= 2^n-1 with equality iff n is a power of 2.
A005811(a(n)) = A000120(n).

A351868 In the decimal expansion of a number, replace each run of consecutive equal digits, say of k consecutive d's, by the decimal expansion of k*d.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 4, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 6, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 8, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 10, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 12, 67, 68
Offset: 0

Views

Author

Rémy Sigrist, Feb 22 2022

Keywords

Comments

A043096 corresponds to fixed points.
Each number appears at least once in this sequence; zeroless numbers (A052382) appear finitely many times, other positive numbers appear infinitely many times.

Examples

			For n = 1066:
- we have three runs of consecutive equal digits: one 1's, one 0's, two 6's,
- 1 * 1 = 1, 1 * 0 = 0, 2 * 6 = 12,
- we obtain: 1, 0, 12,
- so a(1066) = 1012.
		

Crossrefs

Cf. A002275, A043096 (fixed points), A052382, A113589, A175930, A351870.

Programs

  • Mathematica
    Array[FromDigits@ Flatten@ Map[If[Length[#] == 1, #[[1]], IntegerDigits[Length[#]*#[[1]]]] &, Split@ IntegerDigits[#]] &, 69, 0] (* Michael De Vlieger, Feb 25 2022 *)
  • PARI
    a(n, base=10) = { my (d=[]); while (n, my (t=n%base); for (k=0, oo, if (n%base!=t, d=concat(if (t, digits(k*t, base), [0]), d); break, n\=base))); fromdigits(d, base) }
    
  • Python
    from itertools import groupby
    def a(n): return int("".join(str(int(k)*len(list(g))) for k, g in groupby(str(n))))
    print([a(n) for n in range(69)]) # Michael S. Branicky, Feb 23 2022

Formula

a(A002275(n)) = n.

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

A339723 Start with a(1)=1. Thereafter, to get a(n), write a(n-1) in binary, write down all its run lengths, and concatenate them in binary, getting k. Then a(n) = k unless k is already in the sequence, in which case a(n) = smallest missing number.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 9, 13, 11, 14, 10, 15, 12, 16, 17, 18, 27, 22, 29, 19, 26, 23, 20, 30, 21, 31, 24, 25, 28, 32, 33, 34, 35, 36, 54, 45, 59, 37, 55, 38, 53, 47, 39, 40, 41, 61, 42, 63, 43, 62, 44, 58, 46, 48, 49, 50, 51, 52, 56, 57, 60, 64, 65, 66, 67, 68, 69
Offset: 1

Views

Author

Finnegan R. Manthe, Dec 14 2020

Keywords

Examples

			for n=3, a(2) = 2 in binary is 10 with run length 1,1, concatenated is 11 which in base 10 is k=3. So a(3)=3.
For n=7 doing this gives 7 which is already in the sequence (at n=5) so we put 6 as it is the smallest number not already in the sequence.
		

Crossrefs

Cf. A175930 (concatenated run lengths).
Showing 1-4 of 4 results.