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-10 of 11 results. Next

A330925 For any n >= 0: consider all pairs of numbers (x, y) whose binary representations can be interleaved (or shuffled) to produce the binary representation of n (possibly with leading zeros); a(n) is the greatest possible value of x*y.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 2, 3, 0, 4, 4, 6, 4, 6, 6, 9, 0, 8, 8, 12, 8, 12, 12, 15, 8, 12, 12, 18, 12, 18, 18, 21, 0, 16, 16, 24, 16, 24, 24, 28, 16, 24, 24, 30, 24, 30, 30, 35, 16, 24, 24, 36, 24, 36, 36, 42, 24, 36, 36, 42, 36, 42, 42, 49, 0, 32, 32, 48, 32, 48, 48
Offset: 0

Views

Author

Rémy Sigrist, Jan 03 2020

Keywords

Comments

Interleaving (or shuffling) two strings means combining all their characters while preserving the order of all characters in individual strings; for example, "12345" is the interleaving of "14" and "235".

Examples

			For n = 5:
- the binary representation of 5 is "101",
- the possible values for (x, y), restricted to x >= y without loss of generality, are:
  bin(5)   x  y  x*y
  -------  -  -  ---
  "101"    5  0    0
  "1/01"   1  1    1
  "10/1"   2  1    2
  "1/0/1"  3  0    0
- hence a(5) = 2.
		

Crossrefs

Cf. A330955 (x AND y variant), A330958 (x OR y variant), A330959 (x XOR y variant).
Cf. A330956 (min(x, y) variant), A330957 (max(x, y) variant).
Cf. A330960 (x + y variant), A330961 (x - y variant).
Cf. A330962 (x^2 + y^2 variant), A330963 (x^2 - y^2 variant).
See A327186 for similar sequences where we split the binary representation.

Programs

  • C
    See Links section.

Formula

a(n) = 0 iff n is zero or a power of 2.
a(2*n) = 2*a(n).

A327187 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of x XOR y (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 3, 2, 1, 0, 0, 1, 3, 2, 1, 0, 1, 0, 0, 1, 5, 4, 4, 5, 3, 2, 1, 0, 7, 6, 5, 4, 1, 0, 0, 1, 0, 1, 2, 3, 5, 4, 7, 6, 1, 0, 3, 2, 3, 2, 1, 0, 2, 3, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 1, 0, 0, 1, 0, 1, 2, 3, 9, 8, 8, 9, 8, 9, 10, 11, 5, 4, 7, 6, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: 0 XOR 42 = 42,
   - "1" and "01010": x=1 and y=10: 1 XOR 10 = 11,
   - "10" and "1010": x=2 and y=10: 2 XOR 10 = 8,
   - "101" and "010": x=5 and y=2: 5 XOR 2 = 7,
   - "1010" and "10": x=10 and y=2: 10 XOR 2 = 8,
   - "10101" and "0": x=21 and y=0: 21 XOR 0 = 21,
   - "101010" and "": x=42 and y=0: 42 XOR 0 = 42,
- hence a(42) = 7.
		

Crossrefs

See A327186 for other variants.
Cf. A175468.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, bitxor(fromdigits(b[1..w],2), fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 0 iff n = 0 or n belongs to A175468.

A327188 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the greatest possible value of x AND y (where AND denotes the bitwise AND operator).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Comments

The first 10000 positive integers where the sequence equals zero match the first 10000 terms of A082662; is that true forever?

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: 0 AND 42 = 0,
   - "1" and "01010": x=1 and y=10: 1 AND 10 = 0,
   - "10" and "1010": x=2 and y=10: 2 AND 10 = 2,
   - "101" and "010": x=5 and y=2: 5 AND 2 = 0,
   - "1010" and "10": x=10 and y=2: 10 AND 2 = 2,
   - "10101" and "0": x=21 and y=0: 21 AND 0 = 0,
   - "101010" and "": x=42 and y=0: 42 AND 0 = 0,
- hence a(42) = 2.
		

Crossrefs

See A327186 for other variants.
Cf. A082662.

Programs

  • PARI
    a(n) = my (v=-oo, b=binary(n)); for (w=0, #b, v=max(v, bitand(fromdigits(b[1..w],2), fromdigits(b[w+1..#b],2)))); v

A327189 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of x + y.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 10, 11, 12, 3, 4, 5, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 5
Offset: 0

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: 0 + 42 = 42,
   - "1" and "01010": x=1 and y=10: 1 + 10 = 11,
   - "10" and "1010": x=2 and y=10: 2 + 10 = 12,
   - "101" and "010": x=5 and y=2: 5 + 2 = 7,
   - "1010" and "10": x=10 and y=2: 10 + 2 = 12,
   - "10101" and "0": x=21 and y=0: 21 + 0 = 21,
   - "101010" and "": x=42 and y=0: 42 + 0 = 42,
- hence a(42) = 7.
		

Crossrefs

See A327186 for other variants.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, (fromdigits(b[1..w],2) + fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 1 iff n is a power of 2.
a(n) = 2 iff n = 2^k + 1 for some k > 0.

A327191 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of abs(x - y).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: abs(0 - 42) = 42,
   - "1" and "01010": x=1 and y=10: abs(1 - 10) = 9,
   - "10" and "1010": x=2 and y=10: abs(2 - 10) = 8,
   - "101" and "010": x=5 and y=2: abs(5 - 2) = 3,
   - "1010" and "10": x=10 and y=2: abs(10 - 2) = 8,
   - "10101" and "0": x=21 and y=0: abs(21 - 0) = 21,
   - "101010" and "": x=42 and y=0: abs(42 - 0) = 42,
- hence a(42) = 3.
		

Crossrefs

See A327186 for other variants.
Cf. A175468.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, abs(fromdigits(b[1..w],2) - fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 0 iff n = 0 or n belongs to A175468.

A327192 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of max(x, y).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: max(0, 42) = 42,
   - "1" and "01010": x=1 and y=10: max(1, 10) = 10,
   - "10" and "1010": x=2 and y=10: max(2, 10) = 10,
   - "101" and "010": x=5 and y=2: max(5, 2) = 5,
   - "1010" and "10": x=10 and y=2: max(10, 2) = 10,
   - "10101" and "0": x=21 and y=0: max(21, 0) = 21,
   - "101010" and "": x=42 and y=0: max(42, 0) = 42,
- hence a(42) = 5.
		

Crossrefs

See A327186 for other variants.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, max(fromdigits(b[1..w],2), fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 1 iff n = 2^k or n = 2^k + 1 for some k >= 0.

A327193 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the greatest possible value of min(x, y).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: min(0, 42) = 0,
   - "1" and "01010": x=1 and y=10: min(1, 10) = 1,
   - "10" and "1010": x=2 and y=10: min(2, 10) = 2,
   - "101" and "010": x=5 and y=2: min(5, 2) = 2,
   - "1010" and "10": x=10 and y=2: min(10, 2) = 2,
   - "10101" and "0": x=21 and y=0: min(21, 0) = 0,
   - "101010" and "": x=42 and y=0: min(42, 0) = 0,
- hence a(42) = 2.
		

Crossrefs

See A327186 for other variants.

Programs

  • PARI
    a(n) = my (v=-oo, b=binary(n)); for (w=0, #b, v=max(v, min(fromdigits(b[1..w],2), fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 0 iff n = 0 or n is a power of 2.

A327194 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of x^2 + y^2.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 5, 10, 1, 2, 5, 10, 9, 10, 13, 18, 1, 2, 5, 10, 17, 26, 29, 34, 9, 10, 13, 18, 25, 34, 45, 58, 1, 2, 5, 10, 17, 26, 37, 50, 25, 26, 29, 34, 41, 50, 61, 74, 9, 10, 13, 18, 25, 34, 45, 58, 49, 50, 53, 58, 65, 74, 85, 98, 1, 2, 5, 10, 17, 26, 37
Offset: 0

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Comments

This sequence shares graphical features with A286327.

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: 0^2 + 42^2 = 1764,
   - "1" and "01010": x=1 and y=10: 1^2 + 10^2 = 101,
   - "10" and "1010": x=2 and y=10: 2^2 + 10^2 = 104,
   - "101" and "010": x=5 and y=2: 5^2 + 2^2 = 29,
   - "1010" and "10": x=10 and y=2: 10^2 + 2^2 = 104,
   - "10101" and "0": x=21 and y=0: 21^2 + 0^2 = 441,
   - "101010" and "": x=42 and y=0: 42^2 + 0^2 = 1764,
- hence a(42) = 29.
		

Crossrefs

See A327186 for other variants.
Cf. A286327.

Programs

  • Mathematica
    Table[Min[Total[#^2]&/@Table[FromDigits[#,2]&/@TakeDrop[IntegerDigits[n,2],d],{d,0,IntegerLength[n,2]}]],{n,0,80}] (* Harvey P. Dale, Mar 03 2023 *)
  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, fromdigits(b[1..w],2)^2 + fromdigits(b[w+1..#b],2)^2)); v

Formula

a(n) = 1 iff n is a power of 2.

A327195 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the least possible value of abs(x^2 - y^2).

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 3, 8, 1, 0, 0, 5, 9, 8, 5, 0, 1, 0, 0, 5, 12, 21, 21, 16, 9, 8, 5, 0, 7, 16, 27, 40, 1, 0, 0, 5, 0, 9, 20, 33, 25, 24, 21, 16, 9, 0, 11, 24, 9, 8, 5, 0, 7, 11, 0, 13, 49, 48, 45, 40, 33, 24, 13, 0, 1, 0, 0, 5, 0, 9, 20, 15, 48, 65, 77, 72, 65
Offset: 0

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Examples

			For n=42:
- the binary representation of 42 is "101010",
- there are 7 ways to split it:
   - "" and "101010": x=0 and y=42: abs(0^2 - 42^2) = 1764,
   - "1" and "01010": x=1 and y=10: abs(1^2 - 10^2) = 99,
   - "10" and "1010": x=2 and y=10: abs(2^2 - 10^2) = 96,
   - "101" and "010": x=5 and y=2: abs(5^2 - 2^2) = 21,
   - "1010" and "10": x=10 and y=2: abs(10^2 - 2^2) = 96,
   - "10101" and "0": x=21 and y=0: abs(21^2 - 0^2) = 441,
   - "101010" and "": x=42 and y=0: abs(42^2 - 0^2) = 1764,
- hence a(42) = 21.
		

Crossrefs

See A327186 for other variants.
Cf. A175468.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(n)); for (w=0, #b, v=min(v, abs(fromdigits(b[1..w],2)^2 - fromdigits(b[w+1..#b],2)^2))); v

Formula

a(n) = 0 iff n = 0 or n belongs to A175468.
a(n) = 1 iff n is a power of 2.

A327190 For any n > 0: consider the different ways to split the binary representation of 2*n+1 into two nonempty parts, say with value x and y; a(n) is the least possible value of x * y.

Original entry on oeis.org

1, 1, 3, 1, 3, 3, 7, 1, 3, 5, 7, 3, 9, 7, 15, 1, 3, 5, 7, 5, 11, 11, 15, 3, 9, 13, 21, 7, 21, 15, 31, 1, 3, 5, 7, 9, 11, 13, 15, 5, 15, 21, 23, 11, 27, 23, 31, 3, 9, 15, 21, 13, 33, 27, 45, 7, 21, 29, 49, 15, 45, 31, 63, 1, 3, 5, 7, 9, 11, 13, 15, 9, 19, 21
Offset: 1

Views

Author

Rémy Sigrist, Aug 25 2019

Keywords

Comments

All terms are odd.

Examples

			For n=42:
- the binary representation of 85 is "1010101",
- there are 6 ways to split it:
   - "1" and "010101": x=1 and y=21: 1 * 21 = 21,
   - "10" and "10101": x=2 and y=21: 2 * 21 = 42,
   - "101" and "0101": x=5 and y=5: 5 * 5 = 25,
   - "1010" and "101": x=10 and y=5: 10 * 5 = 50,
   - "10101" and "01": x=21 and y=1: 21 * 1 = 21,
   - "101010" and "1": x=42 and y=1: 42 * 1 = 42,
- hence a(42) = 21.
		

Crossrefs

See A327186 for other variants.
Cf. A000225.

Programs

  • PARI
    a(n) = my (v=oo, b=binary(2*n+1)); for (w=1, #b-1, v=min(v, (fromdigits(b[1..w],2) * fromdigits(b[w+1..#b],2)))); v

Formula

a(n) = 1 iff n is a power of 2.
a(n) = n iff n is a positive Mersenne number (A000225). - Bernard Schott, Aug 26 2019
Showing 1-10 of 11 results. Next