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.

A335133 Binary interpretation of the left diagonal of the EQ-triangle with first row generated from the binary expansion of n, with most significant bit given by first row.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 24 2020

Keywords

Comments

For any nonnegative number n, the EQ-triangle for n is built by taking as first row the binary expansion of n (without leading zeros), having each entry in the subsequent rows be the EQ of the two values above it (a "1" indicates that these two values are equal, a "0" indicates that these values are different).
This sequence is a self-inverse permutation of the nonnegative numbers.

Examples

			For n = 42:
- the binary representation of 42 is "101010",
- the corresponding EQ-triangle is:
         1 0 1 0 1 0
          0 0 0 0 0
           1 1 1 1
            1 1 1
             1 1
              1
- the bits on the left diagonal are: 1, 0, 1, 1, 1, 1,
- so a(42) = 2^5 + 2^3 + 2^2 + 2^1 + 2^0 = 47.
		

Crossrefs

Cf. A055010, A070939, A279645, A334727 (XOR variant).

Programs

  • PARI
    a(n) = {
        my (b=binary(n), v=0);
        forstep (x=#b-1, 0, -1,
            if (b[1], v+=2^x);
            b=vector(#b-1, k, b[k]==b[k+1])
        );
        return (v)
    }

Formula

a(floor(n/2)) = floor(a(n)/2).
abs(a(2*n+1) - a(2*n)) = 1.
a(2^k) = 2^k for any k >= 0.
a(2^k+1) = 2^k+1 for any k >= 0.
a(2^k-1) = 2^k-1 for any k >= 0.
Apparently, a(n) + A334727(n) = A055010(A070939(n)) for any n > 0.

A335132 Numbers whose binary expansion generates 3-fold rotationally symmetric EQ-triangles.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 15, 17, 31, 33, 63, 65, 73, 119, 127, 129, 255, 257, 297, 349, 373, 395, 419, 471, 511, 513, 585, 653, 709, 827, 883, 951, 1023, 1025, 1193, 1879, 2047, 2049, 2145, 2225, 2257, 3887, 3919, 3999, 4095, 4097, 4321, 4681, 4777, 5501, 5533, 5941
Offset: 1

Views

Author

Rémy Sigrist, May 24 2020

Keywords

Comments

For any nonnegative number n, the EQ-triangle for n is built by taking as first row the binary expansion of n (without leading zeros), having each entry in the subsequent rows be the EQ of the two values above it (a "1" indicates that these two values are equal, a "0" indicates that these values are different).
The second row in such a triangle has binary expansion given by A279645.
If m belongs to this sequence, then A030101(m) also belongs to this sequence.
All positive terms are odd.
This sequence is a variant of A334556; here we use bitwise EQ, there bitwise XOR.

Examples

			For 349:
- the binary expansion of 349 is "101011101",
- the corresponding EQ-triangle is (with dots instead of 0's for clarity):
     1 . 1 . 1 1 1 . 1
      . . . . 1 1 . .
       1 1 1 . 1 . 1
        1 1 . . . .
         1 . 1 1 1
          . . 1 1
           1 . 1
            . .
             1
- this triangle has 3-fold rotational symmetry, so 349 belongs to this sequence.
		

Crossrefs

Programs

  • PARI
    is(n) = {
        my (b=binary(n), p=b);
        for (k=1, #b,
            if (b[k]!=p[#p], return (0));
            if (p[1]!=b[#b+1-k], return (0));
            p = vector(#p-1, k, p[k]==p[k+1]);
        );
        return (1);
    }
Showing 1-2 of 2 results.