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.

A273106 Numbers representable as ror(k)+rol(k), where ror(k)=A038572(k) is k rotated one binary place to the right, rol(k)=A006257(k) is k rotated one binary place to the left.

This page as a plain text file.
%I A273106 #10 May 09 2021 19:21:05
%S A273106 0,2,3,5,6,8,9,10,14,15,17,19,20,22,24,25,27,29,30,32,33,34,37,38,39,
%T A273106 42,43,44,47,48,51,52,53,56,57,58,61,62,63,65,66,67,68,70,71,72,73,75,
%U A273106 76,77,78,80,81,82,83,85,86,87,88,90,91,92,93,95,96,98
%N A273106 Numbers representable as ror(k)+rol(k), where ror(k)=A038572(k) is k rotated one binary place to the right, rol(k)=A006257(k) is k rotated one binary place to the left.
%t A273106 Take[#, 66] &@ Union@ Table[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2] &@ IntegerDigits[n, 2], {n, 0, 10^3}] (* _Michael De Vlieger_, May 17 2016 *)
%o A273106 (Python)
%o A273106 def ROR(n):                # returns A038572(n)
%o A273106     BL = len(bin(n))-2
%o A273106     return (n>>1) + ((n&1) << (BL-1))
%o A273106 def ROL(n):                # returns A006257(n) for n>0
%o A273106     BL = len(bin(n))-2
%o A273106     return (n*2) - (1<<BL) + 1
%o A273106 a = [0]
%o A273106 for n in range(1, 1000):  a.append(ROR(n) + ROL(n))
%o A273106 print(sorted(set(a)))
%Y A273106 Cf. A006257, A038572, A088161, A088163, A273105.
%K A273106 nonn,base
%O A273106 0,2
%A A273106 _Alex Ratushnyak_, May 15 2016