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

A334591 Side length of largest triangle of zeros in the XOR-triangle with first row generated from the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Peter Kagey, May 07 2020

Keywords

Comments

An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in the subsequent rows be the XOR of the two values above it.
Records occur at a(2^n) = n.
Ones occur at 2, 3, 5, 6, 11, 13, 22, 27, 45, 54, 91, 109, 182, 219, 365, 438, 731, 877, 1462,...
a(n) <= A087117(n).

Examples

			For n = 53, a(53) = 3 because 53 = 110101_2 in binary, and the largest triangle of 0s in the corresponding XOR-triangle has size 3 (see third, fourth, and fifth rows):
  1 1 0 1 0 1
   0 1 1 1 1
    1 0 0 0
     1 0 0
      1 0
       1
		

Crossrefs

Programs

  • Mathematica
    Array[Function[w, Max@ Flatten@ Array[If[# == 1, If[First@ # == 1, Nothing, Length@ #] & /@ Split@ w[[#]], If[First@ # == -1, Length@ #, Nothing] & /@ Split[w[[#]] - Most@ w[[# - 1]] ] ] &, Length@ w] /. -Infinity -> 0]@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &] &, 105] (* Michael De Vlieger, May 08 2020 *)

A334595 Binary interpretation of the right diagonal of the XOR-triangle with first row generated from the binary expansion of n.

Original entry on oeis.org

1, 1, 2, 1, 6, 3, 4, 1, 14, 4, 11, 2, 13, 7, 8, 1, 30, 11, 20, 7, 24, 13, 18, 3, 28, 9, 22, 5, 26, 15, 16, 1, 62, 20, 43, 13, 50, 24, 39, 5, 58, 16, 47, 9, 54, 28, 35, 2, 61, 23, 40, 14, 49, 27, 36, 6, 57, 19, 44, 10, 53, 31, 32, 1, 126, 43, 84, 24, 103, 50
Offset: 1

Views

Author

Peter Kagey, May 07 2020

Keywords

Comments

An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in the subsequent rows be the XOR of the two values above it.
a(n) = n if and only if n is in A334556.
Conjecture: Records occur at 1 and at 2^n + 1.
Conjecture: a(n) = 1 if and only if n is a power of two.

Examples

			For n = 19, the binary expansion of 19 is 10011_2, and the XOR-triangle with first row generated from the binary expansion of 19 is:
  1 0 0 1 1
   1 0 1 0
    1 1 1
     0 0
      0
Reading the right side of the triangle starting from the upper-right corner gives 10100 which is the binary representation of 20 = a(19).
		

Crossrefs

Programs

  • PARI
    a(n) = {my(b=binary(n), v=vector(#b)); v[#b] = b[#b]; for (n=1, #b-1, b = vector(#b-1, k, bitxor(b[k], b[k+1])); v[#b] = b[#b];); fromdigits(Vecrev(v), 2);} \\ Michel Marcus, May 08 2020

A334592 Number of zeros in XOR-triangle with first row generated from the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Peter Kagey, May 07 2020

Keywords

Comments

An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in the subsequent rows be the XOR of the two values above it.
Conjecture: Records occur at powers of two.

Examples

			For n = 53, a(53) = 9 because 53 = 110101_2 in binary, and the corresponding XOR-triangle has 9 zeros:
  1 1 0 1 0 1
   0 1 1 1 1
    1 0 0 0
     1 0 0
      1 0
       1
		

Crossrefs

Programs

  • Mathematica
    Array[Count[Flatten@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &], 0] &, 77] (* Michael De Vlieger, May 08 2020 *)
  • PARI
    a(n) = {my(b=binary(n), nb=#b-hammingweight(n)); for (n=1, #b-1, b = vector(#b-1, k, bitxor(b[k], b[k+1])); nb += #b-vecsum(b);); nb;} \\ Michel Marcus, May 08 2020

Formula

a(n) = A000217(A070939(n)) - A334593(n).

A334593 Number of ones in XOR-triangle with first row generated from the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Peter Kagey, May 07 2020

Keywords

Comments

An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in the subsequent rows be the XOR of the two values above it.
Records occur at 1, 2, 4, 5, 9, 11, 17, 18, 22, 35, 45, 69, 71, 73, 91, 139, 142, 146, 182, ...

Examples

			For n = 53, a(53) = 12 because 53 = 110101_2 in binary, and the corresponding XOR-triangle has 12 ones:
  1 1 0 1 0 1
   0 1 1 1 1
    1 0 0 0
     1 0 0
      1 0
       1
		

Crossrefs

Programs

  • Mathematica
    Array[Total@ Flatten@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &] &, 74] (* Michael De Vlieger, May 08 2020 *)
  • PARI
    a(n) = {my(b=binary(n), nb=hammingweight(n)); for (n=1, #b-1, b = vector(#b-1, k, bitxor(b[k], b[k+1])); nb += vecsum(b);); nb;} \\ Michel Marcus, May 08 2020

Formula

a(n) = A000217(A070939(n)) - A334592(n).

A334596 Number of values in A334556 with binary length n.

Original entry on oeis.org

2, 0, 0, 2, 0, 2, 4, 2, 0, 8, 4, 8, 16, 8, 16, 32, 0, 32, 64, 32, 64, 128, 64, 128, 256, 128, 256, 512, 256, 512, 1024, 512, 0, 2048, 1024, 2048, 4096, 2048, 4096, 8192, 4096, 8192, 16384, 8192, 16384, 32768, 16384, 32768, 65536, 32768, 65536, 131072, 65536, 131072, 262144, 131072
Offset: 1

Views

Author

Peter Kagey, May 07 2020

Keywords

Comments

All nonzero values are powers of two.

Examples

			For n = 11, the a(11) = 4 XOR-triangles of side length 11 are:
  1 0 1 0 1 1 0 0 0 1 1, 1 0 1 1 1 0 0 1 0 1 1,
   1 1 1 1 0 1 0 0 1 0    1 1 0 0 1 0 1 1 1 0
    0 0 0 1 1 1 0 1 1      0 1 0 1 1 1 0 0 1
     0 0 1 0 0 1 1 0        1 1 1 0 0 1 0 1
      0 1 1 0 1 0 1          0 0 1 0 1 1 1
       1 0 1 1 1 1            0 1 1 1 0 0
        1 1 0 0 0              1 0 0 1 0
         0 1 0 0                1 0 1 1
          1 1 0                  1 1 0
           0 1                    0 1
            1                      1
and their reflections across a vertical line.
By reading the first rows in binary, these XOR-triangles correspond to A334556(20) = 1379, A334556(21) = 1483, A334556(22) = 1589, and A334556(23) = 1693 respectively.
		

Crossrefs

Programs

  • Mathematica
    coeff[i_, j_, n_] := Binomial[i, j] - If[j + i == n, 1, 0];
    A334596[1] = 2;
    A334596[n_] := (
       nullsp = NullSpace[
         Table[coeff[i, j, n - 1], {i, 0, n - 1}, {j, 0, n - 1}],
         Modulus -> 2];
       If[AnyTrue[nullsp, #[[1]] == 1 &], 2^(Length[nullsp] - 1), 0]
       );

Formula

Conjectured formula:
a(1) = 2,
a(n) = 0 if n = 2^k + 1 for some k, and
a(n) = 2^A008611(n-4) otherwise.

Extensions

More terms from Rémy Sigrist, May 08 2020

A355255 Irregular table read by rows: a(n,k) gives the number of distinct necklaces that appear in the following procedure: starting with the n-bead, (0,1)-necklace given by k written in binary, repeatedly take the first differences (mod 2) of the beads. 0 <= k < 2^n.

Original entry on oeis.org

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

Views

Author

Peter Kagey, Jun 26 2022

Keywords

Comments

For j >= 1, the sequence a(j,1) begins
2, 3, 2, 5, 4, 4, 8, 9, 8, 8, 32, 8, 64, 16, 16, 17, 16, 16, 512, 16, 64, 64, 2048, 16, 1024, 128, 512, 32, 16384, 32, ...
Conjecture: a(2^m,1) = 2^m + 1 for all m > 1.
Conjecture: a(m,1) is a power of 2 whenever m is not a power of 2.
The sequence of the number of distinct values in the n-th row begins 1, 2, 3, 2, 5, 4, 4, 4, 9, 4, 8, 4, 8, 4, 10, 6, 17, 6, 10, ... - Peter Kagey, Jul 03 2022

Examples

			Table begins:
n\k | 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
----+-----------------------------------------------
  0 | 1;
  1 | 1, 2;
  2 | 1, 3, 3, 2;
  3 | 1, 2, 2, 1, 2, 1, 1, 2;
  4 | 1, 5, 5, 4, 5, 3, 4, 5, 5, 4, 3, 5, 4, 5, 5, 2;
... | ...
a(5,13) = 4 because 13 is 01101 in binary; the sequence of first differences is 01101, 10111, 11000, 01001, 11011, ...; and 10111 is the same necklace as 11011.
		

Crossrefs

Showing 1-6 of 6 results.