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

A334594 Irregular table read by rows: T(n,k) is the binary interpretation of the k-th row of the XOR-triangle with first row generated from the binary expansion of n. 1 <= k <= A070939(n).

Original entry on oeis.org

1, 2, 1, 3, 0, 4, 2, 1, 5, 3, 0, 6, 1, 1, 7, 0, 0, 8, 4, 2, 1, 9, 5, 3, 0, 10, 7, 0, 0, 11, 6, 1, 1, 12, 2, 3, 0, 13, 3, 2, 1, 14, 1, 1, 1, 15, 0, 0, 0, 16, 8, 4, 2, 1, 17, 9, 5, 3, 0, 18, 11, 6, 1, 1, 19, 10, 7, 0, 0, 20, 14, 1, 1, 1, 21, 15, 0, 0, 0
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.
The second column is A038554.

Examples

			Table begins:
   1;
   2, 1;
   3, 0;
   4, 2, 1;
   5, 3, 0;
   6, 1, 1;
   7, 0, 0;
   8, 4, 2, 1;
   9, 5, 3, 0;
  10, 7, 0, 0;
  11, 6, 1, 1;
For the 11th row, the binary expansion of 11 is 1011_2, and the corresponding XOR-triangle is
  1 0 1 1
   1 1 0
    0 1
     1
Reading the rows of this triangle in binary gives 11, 6, 1, 1.
		

Crossrefs

Programs

  • Mathematica
    Array[Prepend[FromDigits[#, 2] & /@ #2, #1] & @@ {#, Rest@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &]} &, 21] // Flatten (* Michael De Vlieger, May 08 2020 *)
  • PARI
    row(n) = {my(b=binary(n), v=vector(#b)); v[1] = n; for (n=1, #b-1, b = vector(#b-1, k, bitxor(b[k], b[k+1])); v[n+1] = fromdigits(b, 2);); v;} \\ Michel Marcus, 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

A333624 Irregular triangle read by rows: T(n,k) = number of triangles of zeros with side length k in the XOR-triangle with first row generated from the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Michael De Vlieger, May 08 2020

Keywords

Comments

An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in subsequent rows be the XOR of the two values above it, i.e., A038554(n) applied recursively until we reach a single bit.
Let b(n) = n written in binary and let L(n) = 1 + floor(log_2(n)) = A070939(n). Let => be a single iteration of XOR across pairs of bits in b(n). Let t(n) be the XOR triangle initiated by b(n). Thus we may refer to any bit in t(n) by the address S(i,j) with 1 <= i <= L(n) and 1 <= j <= L(n) - j + 1.
We detect triangles of zeros, which are "voids" amid surrounding 1's or undefined "space" in the t(n) via run lengths of -1 in S(i,j) - S(i-1,j) for i > 1, and for i = 1, run lengths of zeros.
A334591(n) = length of row n.
From Michael De Vlieger, May 27 2020: (Start)
We can compactify row n by taking the product of prime(k)^T(n,k) for 1 <= k <= A334591(n), decoding the compactified row using A067255. This way, we can compactify the populations of zero-triangles for large n. Example: for n = 151, t(151) has 3 singleton zeros and 4 zero-triangles of side length k = 2. Thus row 151 has {3, 4}. 2^3 * 3^4 = 8 * 81 = 648. A067255(648) = {3, 4}.
A333625(m) = Product(prime(k)^T(m,k)) for m in A334556 (rotationally symmetrical XOR-triangles).
A334896(m) = Product(prime(k)^T(m,k)) for m in A334769 (rotationally symmetrical XOR-triangles with central zero-triangles).
(End)

Examples

			Table begins:
0;
1;
1;
0, 1;
2;
2;
0, 1;
0, 0, 1;
1, 1;
2, 1;
3;
2, 1;
3;
1, 1;
0, 0, 1;
0, 0, 0, 1;
1, 0, 1;
3, 1;
1, 2;
1, 2;
2, 0, 1;
...
Let b(n) = n written in binary. Let => be a single iteration of XOR across pairs of bits in b(n). Let t(n) be the XOR triangle initiated by b(n).
Row 1 contains {0}, since b(1) = 1. Since the XOR triangle that results from a single 1-bit merely consists of that bit and since there are no zeros in the triangle t(1), we write the single term zero in this row.
Row 5 = {2} since b(5) = 101 => 11 => 0. Here we have 2 lone zeros, thus {2}.
Row 12 = {2, 1} since b(12) = 1100 => 010 => 11 => 0. We have 2 isolated zeros and 1 triangle of zeros with side length 2, thus {2, 1}.
		

Crossrefs

Programs

  • Mathematica
    Array[Function[w, If[Length@ # == 0, {0}, ReplacePart[ConstantArray[0, Max@ #[[All, 1]]], Map[#1 -> #2 & @@ # &, #]]] /. -Infinity -> 0 &@ Tally@ Flatten@ Array[If[# == 1, Map[If[First@ # == 1, Nothing, Length@ #] &, Split@ w[[#]] ], Map[If[First@ # == -1, Length@ #, Nothing] &, Split[w[[#]] - Most@ w[[# - 1]] ] ]] &, Length@ w]]@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &] &, 39] // Flatten

A333625 Read terms e = T(n,k) in A333624 as Product(prime(k)^e) for n in A334556.

Original entry on oeis.org

1, 8, 8, 27, 27, 216, 512, 216, 512, 648, 648, 686, 12096, 46656, 262144, 46656, 262144, 12096, 686, 192000, 139968, 192000, 139968, 1866240, 179712, 74088, 91125, 74088, 91125, 179712, 1866240, 343000, 1000000, 5832000, 4251528, 5832000, 80621568, 13824000, 1073741824
Offset: 1

Views

Author

Michael De Vlieger, May 13 2020

Keywords

Comments

Row a(n) of A067255 = row A334556(n) of A333624.
An XOR-triangle t(n) is an inverted 0-1 triangle formed by choosing a top row the binary rendition of n and having each entry in subsequent rows be the XOR of the two values above it, i.e., A038554(n) applied recursively until we reach a single bit.
Let T(n,k) address the terms in the k-th position of row n in A333624.
This sequence encodes T(n,k) via A067255 to succinctly express the number of zero-triangles in A334556(n). To decode a(n) => A333624(A334556(n)), we use A067255(a(n)).

Examples

			Relationship of this sequence to A334556 and A333624:
       n A334556(n) a(n)  Row n of A333624
       -----------------------------------
       1     1        1   0
       2    11        8   3
       3    13        8   3
       4    39       27   0, 3
       5    57       27   0, 3
       6    83      216   3, 3
       7    91      512   9
       8   101      216   3, 3
       9   109      512   9
      10   151      648   3, 4
      11   233      648   3, 4
      12   543      686   1, 0, 0, 3
      13   599    12096   6, 3, 0, 1
      14   659    46656   6, 6
      15   731   262144   18
      16   805    46656   6, 6
      ...
Let b(n) = n written in binary and let L(n) = ceiling(log_2(n)) = A070939(n). Let => be a single iteration of XOR across pairs of bits in b(n). Let t(n) be the XOR triangle initiated by b(n).
a(1) = 0, since b(1) = 1 and row 1 of A333624 is {0}. Since the XOR triangle t(1) that results from a single 1-bit merely consists of that bit and since there are no zeros in the triangle t(1), we write the single term zero in row n of A333624. thus a(n) = prime(1)^0 = 2^0 = 1.
a(2) = 8 because row A334556(2) of A333624 (i.e., the 11th row) has {3}. b(11) = 1011 => 110 => 01 => 1 (a rotationally symmetrical t(11)). We have 3 isolated zeros thus row 11 of A333624 = {3}, therefore a(2) = prime(1)^3 = 2^3 = 8.
a(4) = 27 because row A334556(4) of A333624 (i.e., the 39th row) has {0, 3}. b(39) = 100111 => 10100 => 1110 => 001 => 01 => 1 (a rotationally symmetrical t(39)). We have 3 isolated triangles of zeros with edge length 2, thus row 39 of A333624 = {0, 3}, therefore a(4) = prime(1)^0 * prime(2)^3 = 2^0 * 3^3 = 27.
		

Crossrefs

Programs

  • Mathematica
    With[{s = Rest[Import["https://oeis.org/A334556/b334556.txt", "Data"][[All, -1]] ]}, Map[With[{w = NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &]}, If[Length@ # == 0, 1, Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, #] &@ ReplacePart[ConstantArray[0, Max@ #[[All, 1]]], Map[#1 -> #2 & @@ # &, #]]] &@ Tally@ Flatten@ Array[If[# == 1, Map[If[First@ # == 1, Nothing, Length@ #] &, Split@ w[[#]] ], Map[If[First@ # == -1, Length@ #, Nothing] &, Split[w[[#]] - Most@ w[[# - 1]] ] ]] &, Length@ w]] /. -Infinity -> 0 &, s[[1 ;; 36]]]]

A334896 Read terms e = T(n,k) in A333624 as Product(prime(k)^e) for n in A334769.

Original entry on oeis.org

648, 648, 686, 12096, 12096, 686, 192000, 139968, 192000, 139968, 1866240, 179712, 179712, 1866240, 814968, 2101248, 102036672, 331776000, 102036672, 331776000, 2101248, 814968, 179712000, 4423680000, 1866240000, 131010048, 179712000, 4423680000, 1866240000, 131010048
Offset: 1

Views

Author

Michael De Vlieger, May 23 2020

Keywords

Comments

Row a(n) of A067255 = row A334769(n) of A333624.
An XOR-triangle t(n) is an inverted 0-1 triangle formed by choosing a top row the binary rendition of n and having each entry in subsequent rows be the XOR of the two values above it, i.e., A038554(n) applied recursively until we reach a single bit.
Let T(n,k) address the terms in the k-th position of row n in A333624.
This sequence encodes T(n,k) via A067255 to succinctly express the number of zero-triangles in A334769(n). To decode a(n) => A333624(A334769(n)), we use A067255(a(n)).

Examples

			a(1) = 648, since b(A334769(1)) = b(151) = 10010111, which generates T(151) as shown below, replacing 1 with "@" and 0 with ".":
  @ . . @ . @ @ @
   @ . @ @ @ . .
    @ @ . . @ .
     . @ . @ @
      @ @ @ .
       . . @
        . @
         @
In this figure we see 3 zero-triangles of side length k = 1, and 4 of side length k = 2, therefore, T(1,1) = 3 and T(1,2) = 4. This becomes 2^3 * 3^4 = 8 * 81 = 648.
Relationship of this sequence to A334556 and A333624:
        n  A334769(n)  a(n)  Row n of A333624
      --------------------------------------
       1    151       648    3, 4
       2    233       648    3, 4
       3    543       686    1, 0, 0, 3
       4    599     12096    6, 3, 0, 1
       5    937     12096    6, 3, 0, 1
       6    993       686    1, 0, 0, 3
       7   1379    192000    9, 1, 3
       8   1483    139968    6, 7
       9   1589    192000    9, 1, 3
      10   1693    139968    6, 7
      11   2359   1866240    9, 6, 1
      12   2391    179712    9, 3, 0, 0, 0, 1
      13   3753    179712    9, 3, 0, 0, 0, 1
      14   3785   1866240    9, 6, 1
      15   8607    814968    3, 3, 0, 3, 1
      16   9559   2101248   12, 3, 0, 0, 0, 0, 0, 1
      ...
		

Crossrefs

Programs

  • Mathematica
    With[{s = Rest[Import["https://oeis.org/A334769/b334769.txt", "Data"][[All, -1]]]}, Map[With[{w = NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &]}, If[Length@ # == 0, 1, Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, #] &@ ReplacePart[ConstantArray[0, Max@ #[[All, 1]]], Map[#1 -> #2 & @@ # &, #]]] &@ Tally@ Flatten@ Array[If[# == 1, Map[If[First@ # == 1, Nothing, Length@ #] &, Split@ w[[#]]], Map[If[First@ # == -1, Length@ #, Nothing] &, Split[w[[#]] - Most@ w[[# - 1]]]]] &, Length@ w]] /. -Infinity -> 0 &, s[[1 ;; 29]]]]
Showing 1-8 of 8 results.