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.

Previous Showing 31-31 of 31 results.

A273039 Numbers k such that the following process converges to zero: x(0)=k, x(i+1) = x(i) XOR ror(x(i)) XOR rol(x(i)); see the Comments section for details.

Original entry on oeis.org

0, 5, 6, 9, 24, 29, 34, 40, 43, 45, 48, 51, 54, 57, 65, 66, 68, 71, 75, 77, 80, 83, 86, 89, 90, 92, 101, 102, 111, 129, 130, 135, 139, 141, 153, 154, 159, 180, 189, 198, 204, 209, 216, 219, 226, 231, 232, 238, 257, 260, 263, 267, 272, 275, 277, 278, 282, 284, 297
Offset: 1

Views

Author

Alex Ratushnyak, May 13 2016

Keywords

Comments

Numbers k such that the following process converges to zero: x(0)=k, x(i+1) = x(i) XOR ror(x(i)) XOR rol(x(i)), where XOR is the binary exclusive-or operator, ror(x)=A038572(x) is x rotated one binary place to the right, and similarly rol(x)=A006257(k) is x rotated one binary place to the left.

Examples

			n=5:  x(0)=5, x(1) = 5 xor 6 xor 3 = 0.
n=6:  x(0)=6, x(1) = 6 xor 5 xor 3 = 0.
n=9:  x(0)=9, x(1) = 9 xor 12 xor 3 = 6, x(2)=0.
n=10: x(0)=10, x(1) = 10 xor 5 xor 5 = 10, and x(i)=10 for i>1.
n=17: x(0)=17, x(1) = 17 xor 24 xor 3 = 10, and x(i)=10 for i>1.
So 5, 6, 9 are in the sequence, 10 and 17 are not.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 300], Nest[BitXor[BitXor[#, FromDigits[ RotateRight[ IntegerDigits[#, 2]], 2]], FromDigits[ RotateLeft[ IntegerDigits[#, 2]], 2]] &, #, 120] == 0 &] (* Michael De Vlieger, May 14 2016 *)
  • Python
    def ROR(n):                # returns A038572(n)
        BL = len(bin(n))-2
        return (n>>1) + ((n&1) << (BL-1))
    def ROL(n):                # returns A006257(n)
        BL = len(bin(n))-2
        return (n*2) - (1<
    				
Previous Showing 31-31 of 31 results.