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

A001387 The binary "look and say" sequence.

Original entry on oeis.org

1, 11, 101, 111011, 11110101, 100110111011, 111001011011110101, 111100111010110100110111011, 100110011110111010110111001011011110101, 1110010110010011011110111010110111100111010110100110111011
Offset: 1

Views

Author

Keywords

Comments

I conjecture that the ratio r(n) of the number of "1"s to the number of "0"s in a(n) converges to 5/3 (or some nearby limit). - Joseph L. Pe, Jan 31 2003
The ratio r(n) of the number of "1"s to the number of "0"s in a(n) actually converges to ((101 - 10*sqrt(93))*a^2 + (139 - 13*sqrt(93))*a - 76)/108, where a = (116 + 12*sqrt(93))^(1/3). This ratio has decimal expansion 1.6657272222676... - Nathaniel Johnston, Nov 07 2010 [Corrected by Kevin J. Gomez, Dec 12 2017]
Reading terms as binary numbers and converting to decimal gives A049190. - Andrey Zabolotskiy, Dec 12 2017
From Jianing Song, Oct 05 2022: (Start)
"000" or "11111" never appear in any a(n). Proof:
When "000" appears for the first time in a(n),
- if it reads as "..00 0's", then a(n-1) must contain at least 4 consecutive 0's, which is impossible;
- if it reads as "...000... 0's" or "...000... 1's", then a(n-1) must contain at least 8 consecutive 0's or at least 8 consecutive 1's.
In conclusion, a(n-1) must contain at least 8 consecutive 1's.
When "11111" appears for the first time in a(n),
- if it reads as "...1111 1's", then a(n-1) must contain at least 15 consecutive 1's, which is impossible;
- if it reads as "...111 1's, 1... 0's", then a(n-1) must contain at least 7 consecutive 1's, which is impossible;
- if it reads as "...11 1's, 11... 0's", then a(n-1) must contain at least 3 consecutive 0's;
- if it reads as "...1 1's, 111... 0's", then a(n-1) must contain at least 7 consecutive 0's;
- if it reads as "... 1's, 1111... 0's", then a(n-1) must contain at least 15 consecutive 0's;
- if it reads as "...11111... 0's" or "...11111... 1's", then a(n-1) must contain at least 31 consecutive 0's or at least 31 consecutive 1's.
In conclusion, a(n-1) must contain at least 3 consecutive 0's. Combining these two results, one can easily show that "000" or "11111" cannot appear. (End)

Examples

			To get the 5th term, for example, note that 4th term has three (11 in binary!) 1's, one (1) 0 and two (10) 1's, giving 11 1 1 0 10 1.
		

Crossrefs

Programs

  • Mathematica
    a[1] := 1; a[n_] := a[n] = FromDigits[Flatten[{IntegerDigits[Length[#],2], First[#]}& /@ Split[IntegerDigits[a[n-1]]]]]; Map[a, Range[20]] (* Peter J. C. Moses, Mar 24 2013 *)
    Nest[Append[#, FromDigits@ Flatten@ Map[Reverse /@ IntegerDigits[Tally@ #, 2] &, Split@ IntegerDigits@ Last@ #]] &, {1}, 9] (* Michael De Vlieger, Dec 12 2017 *)
  • Python
    from itertools import accumulate, groupby, repeat
    def summarize(n, _): return int("".join(bin(len(list(g)))[2:]+k for k, g in groupby(str(n))))
    def aupto(terms): return list(accumulate(repeat(1, terms), summarize))
    print(aupto(11)) # Michael S. Branicky, Sep 18 2022

Extensions

New name from Andrey Zabolotskiy, Dec 13 2017

A056966 In binary: write what is described (putting a leading zero on numbers which have an odd number of binary digits).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 4, 5, 3, 3, 6, 7, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0
Offset: 0

Views

Author

Henry Bottomley, Jul 20 2000

Keywords

Examples

			a(54)=2 because 54 = 110110 base 2, which can be read as one 1 followed by zero 1's followed by one 0, i.e., 10 base 2 = 2 base 10.
		

Crossrefs

Programs

  • Python
    def A056966(n):
        s = bin(n)[2:]
        s = '0'*(len(s)&1)+s
        return int('0'+''.join(s[i+1]*int(s[i])for i in range(0,len(s),2)),2) # Chai Wah Wu, Feb 12 2023

A259710 Describe previous term in binary, then convert to decimal (initial term is 0).

Original entry on oeis.org

0, 2, 14, 30, 38, 918, 31190, 1261014, 1925823958, 66980978212310, 88736005061423513046, 284201453518322998760440446422, 21227119308677323964491588521405117134126550, 1978879038810329481388510354539283798664092126944649356922961366
Offset: 1

Views

Author

Kade Robertson, Jul 03 2015

Keywords

Examples

			E.g., the term after 14 can be obtained by changing 14 to binary 1110_2, then describing in binary as three (11_2) ones and one (1) zero, concatenate these to make 11110_2, then convert back to decimal to obtain 30.
		

Crossrefs

Cf. A049064, A049190 (initial term is 1).

Formula

a(n) = base-10(A049064(n)).

Extensions

Offset corrected by Jianing Song, Mar 16 2019

A321226 Describe the binary representation of n in binary and convert back to decimal.

Original entry on oeis.org

2, 3, 14, 5, 28, 59, 22, 7, 30, 115, 238, 117, 44, 91, 30, 9, 56, 123, 462, 229, 476, 955, 470, 119, 46, 179, 366, 181, 60, 123, 38, 11, 58, 227, 494, 245, 924, 1851, 918, 231, 478, 1907, 3822, 1909, 940, 1883, 478, 233, 88, 187, 718, 357, 732, 1467, 726, 183
Offset: 0

Views

Author

Rémy Sigrist, Nov 10 2018

Keywords

Comments

This sequence is a binary variant of the "Look and Say" sequence A045918.
There is only one fixed point: a(7) = 7.

Examples

			For n = 67:
- the binary representation of 67 is "1000011",
- we see, in binary: "1" "1", "100" "0", "10" "1",
- hence the binary representation of a(67) is "111000101",
- and a(67) = 453 in decimal.
		

Crossrefs

Programs

  • PARI
    a(n, b=2) = if (n==0, return (b)); my (d=digits(b*n, b), v=0, w=0); d[#d] = -1; for (i=1, #d-1, w++; if (d[i]!=d[i+1], v = b*(v*b^#digits(w, b) + w) + d[i]; w = 0)); v

Formula

a(2^n - 1) = 2*n + 1 for any n > 0.
a(4*n + 1) = 4*a(2*n) + 3 for any n > 0.
a(4*n + 2) = 4*a(2*n + 1) + 2 for any n >= 0.
a(A020330(2*n)) = A020330(a(2*n)) for any n > 0.
a(A049190(n)) = A049190(n+1) for any n > 0.

A049192 Start with 1. Read as base 10, convert to base 2, describe it in base 2.

Original entry on oeis.org

1, 11, 1110101, 1110001001101011101110111011, 1111001110101110111011101001101011011101011011101001101001101111001111100011101110010111001111010111010110011110101
Offset: 1

Views

Author

Keywords

Comments

Next term has 486 digits.

Examples

			1->1->One 1->11;
11->1011->One 1,One 0, Two Ones->1110101;
etc.
		

Crossrefs

Cf. A005150.

Extensions

Definition corrected (was identical to A049190) by Andrew Pope, Aug 21 2023
Showing 1-5 of 5 results.