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.

A084484 a(n) = A007088(A084483(n)).

Original entry on oeis.org

1, 100, 11, 10, 1001, 1100, 111, 10000, 101, 10100, 10011, 110, 11001, 11100, 1111, 1000, 100001, 100100, 1011, 1010, 101001, 101100, 100111, 110000, 1101, 110100, 110011, 1110, 111001, 111100, 11111, 1000000, 10001, 1000100, 1000011, 10010, 1001001, 1001100
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2003

Keywords

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = If[OddQ[n], 2*s[(n - 1)/2] + 1, If[EvenQ[IntegerExponent[n, 2]], n/2, 2*n]]; FromDigits[IntegerDigits[#, 2]]& /@ Array[s, 50] (* Amiram Eldar, Jul 22 2023 *)

Formula

a(n) = A007088(n) iff A000120(n) = A070939(n).

A266150 Take the binary representation of n, increase each run of 0's by one 0 if the length of run is odd, otherwise, if length of run is even, remove one 0. a(n) is the decimal equivalent of the result.

Original entry on oeis.org

0, 1, 4, 3, 2, 9, 12, 7, 16, 5, 36, 19, 6, 25, 28, 15, 8, 33, 20, 11, 18, 73, 76, 39, 48, 13, 100, 51, 14, 57, 60, 31, 64, 17, 132, 67, 10, 41, 44, 23, 144, 37, 292, 147, 38, 153, 156, 79, 24, 97, 52, 27, 50, 201, 204, 103, 112, 29, 228, 115, 30, 121, 124, 63, 32
Offset: 0

Views

Author

Alex Ratushnyak, Dec 21 2015

Keywords

Comments

This is a self-inverse permutation of the positive integers.

Examples

			a(4) = 2 since 4 = 100 binary -> 10 = 2 decimal.
a(5) = 9 since 5 = 101 binary -> 1001 = 9 decimal.
a(6) = 12 since 6 = 110 binary -> 1100 = 12 decimal.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[#, 2] &@ Flatten[If[First@ # == 0, If[OddQ@ Length@ #, Append[IntegerDigits@ #, 0], Most@ IntegerDigits@ #], #] & /@ Split@ IntegerDigits[n, 2]], {n, 64}] (* Michael De Vlieger, Dec 22 2015 *)
  • PARI
    a(n) = if (n==0, 0, my (b=n%2, r=valuation(n+b, 2), rr=if (b, r, r%2, r+1, r-1)); (a(n\2^r)+b)*2^rr-b) \\ Rémy Sigrist, Jan 20 2019

Extensions

a(0) = 0 prepended by Rémy Sigrist, Jan 20 2019

A266151 Take the binary representation of n, increase each run of 1's by one 1 if the length of run is odd, otherwise, if length of run is even, remove one 1. a(n) is the decimal equivalent of the result.

Original entry on oeis.org

0, 3, 6, 1, 12, 27, 2, 15, 24, 51, 54, 13, 4, 11, 30, 7, 48, 99, 102, 25, 108, 219, 26, 111, 8, 19, 22, 5, 60, 123, 14, 63, 96, 195, 198, 49, 204, 411, 50, 207, 216, 435, 438, 109, 52, 107, 222, 55, 16, 35, 38, 9, 44, 91, 10, 47, 120, 243, 246, 61, 28, 59, 126, 31
Offset: 0

Views

Author

Alex Ratushnyak, Dec 21 2015

Keywords

Comments

This is a self-inverse permutation of the positive integers.

Examples

			a(4) = 12 since 4 = 100 binary -> 1100 = 12 decimal,
a(5) = 27 since 5 = 101 binary -> 110011 = 27 decimal,
a(6) = 2 since 6 = 110 binary -> 10 = 2 decimal.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[#, 2] &@ Flatten[If[First@ # == 1, If[OddQ@ Length@ #, Append[IntegerDigits@ #, 1], Most@ IntegerDigits@ #], #] & /@ Split@ IntegerDigits[n, 2]], {n, 63}] (* Michael De Vlieger, Dec 22 2015 *)
  • PARI
    a(n) = if (n==0, 0, my (b=n%2, r=valuation(n+b, 2), rr=if (b==0, r, r%2, r+1, r-1)); (a(n\2^r)+b)*2^rr-b) \\ Rémy Sigrist, Jan 20 2019

Extensions

a(0) = 0 prepended by Rémy Sigrist, Jan 20 2019
Showing 1-3 of 3 results.