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.
%I A273039 #20 Jun 11 2025 12:33:00 %S A273039 0,5,6,9,24,29,34,40,43,45,48,51,54,57,65,66,68,71,75,77,80,83,86,89, %T A273039 90,92,101,102,111,129,130,135,139,141,153,154,159,180,189,198,204, %U A273039 209,216,219,226,231,232,238,257,260,263,267,272,275,277,278,282,284,297 %N 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. %C 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)), 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. %e A273039 n=5: x(0)=5, x(1) = 5 xor 6 xor 3 = 0. %e A273039 n=6: x(0)=6, x(1) = 6 xor 5 xor 3 = 0. %e A273039 n=9: x(0)=9, x(1) = 9 xor 12 xor 3 = 6, x(2)=0. %e A273039 n=10: x(0)=10, x(1) = 10 xor 5 xor 5 = 10, and x(i)=10 for i>1. %e A273039 n=17: x(0)=17, x(1) = 17 xor 24 xor 3 = 10, and x(i)=10 for i>1. %e A273039 So 5, 6, 9 are in the sequence, 10 and 17 are not. %t A273039 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 *) %o A273039 (Python) %o A273039 def ROR(n): # returns A038572(n) %o A273039 BL = len(bin(n))-2 %o A273039 return (n>>1) + ((n&1) << (BL-1)) %o A273039 def ROL(n): # returns A006257(n) %o A273039 BL = len(bin(n))-2 %o A273039 return (n*2) - (1<<BL) + 1 %o A273039 for n in range(1000): %o A273039 X = n %o A273039 Xs = [] %o A273039 while not (X in Xs): %o A273039 Xs.append(X) %o A273039 if X==0: %o A273039 print(n, end=', ') %o A273039 break %o A273039 X = X ^ ROR(X) ^ ROL(X) %Y A273039 Cf. A038572, A006257. %K A273039 nonn,base %O A273039 1,2 %A A273039 _Alex Ratushnyak_, May 13 2016