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

A175950 A175948(n)-A175949(n).

Original entry on oeis.org

0, 0, 0, -2, 0, 2, 0, -6, -2, 0, -2, 0, 4, 6, 0, -14, -6, -4, -8, 2, 0, -2, -6, -4, 2, 4, 6, 4, 12, 14, 0, -30, -14, -12, -20, -6, -12, -14, -20, 6, 6, 0, 2, 0, -4, -6, -14, -12, -2, 0, 0, 14, 8, 6, 10, 0, 10, 12, 22, 12, 28, 30, 0, -62, -30, -28, -44, -22, -36, -38, -48, -10, -18
Offset: 1

Views

Author

Dylan Hamilton, Oct 28 2010

Keywords

Comments

A difference between two ways of encoding-decoding run lengths of 0's and 1's in the binary representation of n.

Programs

  • Mathematica
    takelist[l_, t_] := Module[{lent, term},Set[lent, Length[t]]; Table[l[[t[[y]]]], {y, 1, lent}]]
    frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
    binrep[x_] := repcount[IntegerDigits[x, 2]]
    onebinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[1,Length[b],2]]]
    zerobinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[2,Length[b],2]]]
    Table[frombinrep[Flatten[{onebinrep[n], zerobinrep[n]}]], {n,START,END}]-Table[frombinrep[Flatten[{zerobinrep[n], onebinrep[n]}]], {n,START,END}]

A175949 Numbers obtained by concatenation of the binary representation of A175946(n) and A175945(n).

Original entry on oeis.org

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

Views

Author

Dylan Hamilton, Oct 28 2010

Keywords

Comments

The operation as in A175948, but the run-length encoding of zeros (A175946) is placed left from the run-length encoding of ones (A175945).

Examples

			n=9 is 1001 in binary. Run lengths of 0's are 2 (one run of length 2) and of 1's are 11 (two runs each of length 1). The concatenation of these lengths is 211, which is interpreted as 2 one's, 1 zero, 1 one, binary 1101, and recoded decimal as a(9)=8+4+1 =13.
		

Programs

  • Mathematica
    takelist[l_, t_] := Module[{lent, term},Set[lent, Length[t]]; Table[l[[t[[y]]]], {y, 1, lent}]]
    frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
    binrep[x_] := repcount[IntegerDigits[x, 2]]
    onebinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[1,Length[b],2]]]
    zerobinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[2,Length[b],2]]]
    Table[frombinrep[Flatten[{zerobinrep[n], onebinrep[n]}]], {n,START,END}]
Showing 1-2 of 2 results.